I'll admit I'm not much of a C expert, so I'd say Guy has a much better handle 
on that part than I do.  As far as your code goes I only had one thought, and 
forgive me if this is just my ignorance of VBA.  I didn't see a declaration for 
lReturnedRows anywhere.  If you don't declare a variable, what is the value of 
that variable if it's used before you explicitly assign a value?  The reason I 
ask is because you only assign a value to lReturnedRows if the length of the 
error message is 0, and you only set the error flag if lReturnedRows = 0.  Do 
you need to do:

If Len(strError) = 0 then
Else
  lReturnedRows = 0
End If

Don't know if this would really make a difference, and sorry if it's just a 
waste of time, but I thought I'd suggest it.

--
Eric Pankoke
Founder / Lead Developer
Point Of Light Software
http://www.polsoftware.com/

 -------------- Original message ----------------------
From: [EMAIL PROTECTED]
> Thanks for looking at that.
> The crash can happen at the actual call to sqlite_get_table or it can
> happen when I assign the resulting array to the wrapper function, so when
> I do: GetFromDB = arr
> 
> Yes, I would be interested in making a boolean (optional) argument in
> sqlite_get_table that can leave out the field headers. I haven't tried
> to compile myself yet, but I do have VC6, so it should be OK.
> 
> Still, I don't understand why this crashes.
> 
> RBS
> 
> > At 07:44 2/2/2007 +0000, you wrote:
> >>Sure, here it is:
> >
> > <snip>
> >
> > Looking at the C code published at
> > http://www.tannertech.net/sqlite3vb/index.htm , it seems very risky -
> > there
> > are a lot of places it can fail to allocate memory (for example), and the
> > use of some variables looks like it could randomly crash at any time...
> > but
> > I didn't test it, just looked at it.
> >
> > As far as I can understand the problem, it happens around this line:
> > arr = GetFromDB(strSQL, lRows, strError, lDBHandle, strDB)
> >
> > Are you seeing a crash on the actual call to sqlite_get_table or only
> > after
> > it (when you try to use the results)?
> >
> > If you compiled the SQLite3VB.dll on your own, I can probably make some
> > suggestions about fixing the C code of sqlite_get_table implementation,
> > and
> > maybe even some improvments (for example, a boolean flag to allow you to
> > request the results array without the column headers, which I remember you
> > asking about), and returning the number of rows immediately instead of in
> > another function (which is somewhat dangerous), etc.).
> > You should also probably consider using some kind of wrapper around
> > sqlite3_exec in addition to sqlite3_get_table so you will be able to run
> > commands (like pragma) without going through sqlite_get_table.
> >
> >
> > Guy
> >
> >
> >
> > -----------------------------------------------------------------------------
> > To unsubscribe, send email to [EMAIL PROTECTED]
> > -----------------------------------------------------------------------------
> >
> >
> >
> 
> 
> 
> 
> -----------------------------------------------------------------------------
> To unsubscribe, send email to [EMAIL PROTECTED]
> -----------------------------------------------------------------------------
> 


-----------------------------------------------------------------------------
To unsubscribe, send email to [EMAIL PROTECTED]
-----------------------------------------------------------------------------

Reply via email to