Using the latest SQLite3 on Windows, accessed from an ActiveX dll.
Come across a strange bug that I just can't unravel:
I have a 2 dimensional VB6 variant array that I am moving to a SQLite table.
This variant array is obtained from a .csv text file.
The first column of this variant array holds integer values and apparently
randomly
the bound values appear wrongly as -1, whereas it should be 1 or whatever
else integer
value. I am testing this on a variant array with some 100000 rows and the
great majority
of the values of the first column of this variant array appear wrongly as
-1, but other values
appear fine. I can see no pattern to this.
I am logging these integer values to be bound, just prior to the binding
and they are
indeed fine, so as expected.
These integer values are then bound like this:
sqlite3_bind_int lStatementHandle, ByVal c, ByVal CLng(vArray(r, c))
I also tried without the CLng conversion:
sqlite3_bind_int lStatementHandle, ByVal c + btLBAdd, ByVal vArray(r, c)
Then when I check these integer values after the binding like this:
lPtr = sqlite3_expanded_sql(lStatementHandle)
GetSQLFromStatementHandle = cConn.PointerToString(lPtr, CP_UTF8)
sqlite3_free lPtr
I can see the wrongly bound -1 values.
This problem only occurs in the first column of this variant array, whereas
other integer
values in further columns of this array are bound all fine.
I can see that very likely this is a bug in my VB6 coding, but I just can't
find it and maybe
somebody has some bright idea as to what might be going on here.
RBS
_______________________________________________
sqlite-users mailing list
[email protected]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users