Re: [sqlite] Problem with sqlite3_bind_int

2017-01-20 Thread Bart Smissaert
> What is this btLBAdd that you have in one place but not the other?

To avoid confusion I took the correction factor out of the first code line,
but not the second. My fault.
This correction factor is to accommodate both 0-based and 1-based arrays
(VB6 can do that).
This is not the problem.

I think I am on the right track now.
I checked the bound values after binding a whole row, but should check
after every value and can see now where it goes wrong.
Sure this will be fixed soon now and indeed nil to do with SQLite.


RBS



On Fri, Jan 20, 2017 at 11:33 PM, Igor Tandetnik  wrote:

> On 1/20/2017 6:15 PM, Bart Smissaert wrote:
>
>> Good idea,
>> I have checked for this but will double check again.
>> The problem arises already with the very first element of the variant
>> array
>> and my log shows the problem:
>>
>> logged before the bind:
>> vArray(0, 0): 1
>>
>
> Wait, you are indexing from 0? sqlite3_bind_int numbers parameters
> starting from 1. What is this btLBAdd that you have in one place but not
> the other?
>
> Also, as a sanity check, print CType() of that element and, if it's a
> string, the length of that string.
>
> --
> Igor Tandetnik
>
> ___
> sqlite-users mailing list
> sqlite-users@mailinglists.sqlite.org
> http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
>
___
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Problem with sqlite3_bind_int

2017-01-20 Thread Igor Tandetnik

On 1/20/2017 6:15 PM, Bart Smissaert wrote:

Good idea,
I have checked for this but will double check again.
The problem arises already with the very first element of the variant array
and my log shows the problem:

logged before the bind:
vArray(0, 0): 1


Wait, you are indexing from 0? sqlite3_bind_int numbers parameters 
starting from 1. What is this btLBAdd that you have in one place but not 
the other?


Also, as a sanity check, print CType() of that element and, if it's a 
string, the length of that string.

--
Igor Tandetnik

___
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Problem with sqlite3_bind_int

2017-01-20 Thread Bart Smissaert
Good idea,
I have checked for this but will double check again.
The problem arises already with the very first element of the variant array
and my log shows the problem:

logged before the bind:
vArray(0, 0): 1

logged after the first row has all the values bound:
bound value: -1

There are no Boolean True values in the variant array.


RBS












On Fri, Jan 20, 2017 at 10:57 PM, Igor Tandetnik  wrote:

> On 1/20/2017 4:55 PM, Bart Smissaert wrote:
>
>> These integer values are then bound like this:
>>
>> sqlite3_bind_int lStatementHandle, ByVal c, ByVal CLng(vArray(r, c))
>>
>
> My guess: some CSV fields contain non-digit characters (perhaps invisible
> control characters), and so numeric coersion fails on them, and perhaps
> CLng() returns -1 to indicate failure. Another possibility is that the
> variant contains boolean True value; VB6 represents it numerically as -1
>
> --
> Igor Tandetnik
>
>
> ___
> sqlite-users mailing list
> sqlite-users@mailinglists.sqlite.org
> http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
>
___
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Problem with sqlite3_bind_int

2017-01-20 Thread Igor Tandetnik

On 1/20/2017 4:55 PM, Bart Smissaert wrote:

These integer values are then bound like this:

sqlite3_bind_int lStatementHandle, ByVal c, ByVal CLng(vArray(r, c))


My guess: some CSV fields contain non-digit characters (perhaps 
invisible control characters), and so numeric coersion fails on them, 
and perhaps CLng() returns -1 to indicate failure. Another possibility 
is that the variant contains boolean True value; VB6 represents it 
numerically as -1


--
Igor Tandetnik

___
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Problem with sqlite3_bind_int

2017-01-20 Thread Bart Smissaert
> or storing the right values but recalling them incorrectly

I am 100% sure they are recalled correctly but bound wrongly. Verified this
in various different ways.

RBS

On Fri, Jan 20, 2017 at 9:59 PM, Simon Slavin  wrote:

>
> On 20 Jan 2017, at 9:55pm, Bart Smissaert 
> wrote:
>
> > 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.
>
> If you’re not sure about this then it will hamper your attempts to
> investigate.  Try using the SQLite command-line tool to look at your
> database file.  You should be able to easily discover what values are
> actually being stored in the file.  Once you’ve done that you will have a
> better idea whether your API is storing the wrong values, or storing the
> right values but recalling them incorrectly.
>
> Simon.
> ___
> sqlite-users mailing list
> sqlite-users@mailinglists.sqlite.org
> http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
>
___
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Problem with sqlite3_bind_int

2017-01-20 Thread Simon Slavin

On 20 Jan 2017, at 9:55pm, Bart Smissaert  wrote:

> 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.

If you’re not sure about this then it will hamper your attempts to investigate. 
 Try using the SQLite command-line tool to look at your database file.  You 
should be able to easily discover what values are actually being stored in the 
file.  Once you’ve done that you will have a better idea whether your API is 
storing the wrong values, or storing the right values but recalling them 
incorrectly.

Simon.
___
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users