Re: RE: Use of TSQLServer

From: Marina Giunta <giunta_at_mail.cern.ch>
Date: Fri, 8 Apr 2005 11:13:19 +0200 (CEST)


Hi,
thanks, I was able to get the field content, but only for the field "1", if I do row->GetField(0) I'm kicked out from root (root crashes) without any kind of error message.
This is the code; it runs perfectly if I initialize k=1, but crashes if I initialize it to 0:

  TSQLResult *res=db->Query(sql);
  int nfields = res->GetFieldCount(); //it returns nfields=2   TSQLRow *row=res->Next();

/*print out all rows*/
  do
  {
    for(int k=0; k<nfields; k++) {

      char* fieldCont = *(char**)row->GetField(k);
      printf("%s\n", fieldCont);

    }
  }while (res->Next());

Thanks.

               Marina Received on Fri Apr 08 2005 - 11:13:24 MEST

This archive was generated by hypermail 2.2.0 : Tue Jan 02 2007 - 14:45:06 MET