Options

reading blob using cfront

jksjks Member Posts: 277
Hi all,

Can anybody tell me how can i read the value of the blob field using cfront(inside c++ program)?

What is the difference between cfront.ocx and simple cfront(i.e cfrontsql.dll)?

Do i need to use ocx to access blob fields?

Please help.

Comments

  • Options
    fbfb Member Posts: 246
    The function 'VerifyTestData' in the c/front sample program 'sample.c' contains the following code that peeks at the contents of a BLOB field (field # 90):
    .
        .
        .
        memset(s, i, sizeof(s));
        FieldDataAddr = DBL_GetFieldDataAddr(hTable,hRec,90);
        if (memcmp(FieldDataAddr,s,sizeof(s)))
        {
          printf("BLOB field differs %d\nError !!\n",i);
          DBL_FreeRec(hRec);
          return(-1);
        }
        if(sizeof(s) != DBL_GetFieldDataSize(hTable,90,FieldDataAddr))
        {
          printf("BLOB field datasize %d\nError !!\n",i);
          DBL_FreeRec(hRec);
          return(-1);
        }
        .
        .
        .
    
    The key functions here are 'DBL_GetFieldDataAddr' (returns a pointer to the beginning of the BLOB data, and 'DBL_GetFieldDataSize' (returns the length of the BLOB data).

    Hope this helps.
  • Options
    jksjks Member Posts: 277
    How can i declare a pointer to blob data type?

    Because when i specify like
    DBL_BLOB *dblob;
    Then it gives an error that DBL_BLOB undefiened identifier.

    Please help.
Sign In or Register to comment.