LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

DBGetVariantArrayValue causes error in release.exe

The SQL Toolkit function DBGetVariantArrayValue causes an error if i try to fetch the value of the last column in the first field of an table.

 

This does not happen on the Developer PC (Win7 x32) but on a Measurement PC (WinXP x32/ Win7 x64) it happens reproducibly.

 

my code Extraction:

//Get Array of Varriants
resCode = DBGetVariantArray (hstmt, &cArray, &numRecs, &numFields);

if (resCode != -10) {
   int colType[numFields];
   for (int j = 0; j < numFields; j++) {
       colType[j] = DBColumnType(hstmt,j+1);	
       }

   //Iterates through the Array of result strings:
   for (int i = 0; i < numRecs; i++) {
       for (int j = 0; j < numFields; j++) {
	//Because of NULL-values in Database tables  
        //"DBGetVariantArrayValue" throws Non-fatal error messages,
	//these are extreamly disturbing for debugging, so we disabled
        // and enabled it. 
	SetBreakOnLibraryErrors(0);	//Disable Break on Error
        //Sets results of VarriantArray to strings:
	resCode = DBGetVariantArrayValue (cArray, numRecs, numFields, CAVT_CSTRING, i, j, &tmpVal);
	SetBreakOnLibraryErrors(1); 	//Enable Break on Error

//...Further processing...

 Table from a SQL Anywhere 11 Database:

ID

Date

SerialNr

File

Type

Value1

Value2

Value3

int

UDT_DATETIME

UDT_LABELSTRING

UDT_LABELSTRING

UDT_LABELSTRING

UDT_REAL

UDT_REAL

UDT_INT

1

2011-08-12 12:00:30:50.000

SN1

asdf.txt

yxcv

1,23456789

9,87654321

200

2

2011-08-12 12:00:30:50.000

SN1

asdf.txt

yxcv

1,23456789

9,87654321

200

3

2011-08-12 12:00:30:50.000

SN1

asdf.txt

yxcv

1,23456789

9,87654321

200

4

2011-08-12 12:00:30:50.000

SN1

asdf.txt

yxcv

1,23456789

9,87654321

200

5

2011-08-12 12:00:30:50.000

SN1

asdf.txt

yxcv

1,23456789

9,87654321

200

...

...

...

...

...

...

...

...

 

Error orcures if my Code tries to fetch Value3 of the first line.

 

 

are there any ideas? 

 

best regards

0 Kudos
Message 1 of 1
(2,950 Views)