Thank you for the answer. Actually, I've already scattered MessageBox()
calls through the code, and I've found out exactly where the error happens.
For example, in a database where searching for text "key1" (column a)
returns "value1", "value2", "value3", and "value4" in column b, the callback
fnuction of that code would be called THREE times, returning thus three
message boxes:
 - key1 -> value1
 - key1 -> value2
 - key1 -> value3
And, in the fourth call to the callback function in this same sqlite3_exec
call, it gives "Access Violation", and never gets to reach the callback
function for the fourth time. But, if there were only value1, value2 and
value3, it would work fine. Actually, if we called, several times,
sqlite3_exec() for an SELECT that return 3 or less calls to the callback
function, it would work fine. Thus, it runs into trouble apparently when it
is about to call the callback function for the fourth time in a same
sqlite3_exec.
Call stack just after the error happens (I'm not very sure of what it means,
because I'm a beginner):
KERNEL32.dll: GetCurrentDirectoryW( ) + 44
test.exe: 00401265
test.exe: WinMain( ) + 71
sqlite3.dll: sqlite3_exec( ) + 154
sqlite3.dll: sqlite3_column_text( ) + 1A
sqlite3.dll: sqlite3_data_count( ) + AC
ntdll.dll: RtlEnterCriticalSection( ) + B
I'm not very sure if it is all the information that you need.
Thank you in advance.
2007/12/12, Trevor Talbot <[EMAIL PROTECTED]>:

> On 12/12/07, CAVALO SCHMIDT <[EMAIL PROTECTED]> wrote:
>
> > I'm programing in C, new to SQLite, in Windows, with the Pelles C
> Compiler
> > for Windows.
>
> > It works well. BUT, when I try to put this code in a Win32 application,
> like
> > inside a WinMain procedure, for example, a strange behavior happens:
> > everytime sqlite3_exec finds exactly more than 3 records in the
> database, it
> > gives an "Access Violation" error. Pelles C's debugger gives "Exception:
> > Access Violation", apparently in NTDLL.DLL. It happens with any database
> of
> > any size, as long as SELECT returns more than 3 results. We tested it in
> 2
> > computers Windows XP Pro (one of them 2.4 GHz and 1GB RAM, and the
> > other 1.1GHz and 384 MB RAM), and, in both of them, the error happens
> > every time
> > SELECT finds more than 3 records (so, I could never have noticed it if I
> had
> > tested it only with SELECTs that return 3 or less results); we tried to
> > increase Stack Reserve size, but no difference. Important to notice is
> the
> > fact that it works fine in a Console application, and also in
> sqlite3.exe it
> > works fine.
>
> You'll need to get more information out of the debugger, like a stack
> trace. Alternatively, scatter MessageBox() calls through your code to
> find out where it is when it runs into trouble.
>
>
> -----------------------------------------------------------------------------
> To unsubscribe, send email to [EMAIL PROTECTED]
>
> -----------------------------------------------------------------------------
>
>

Reply via email to