I don't really need the loop and I could just do:

        If SQLiteConn.State <> slStateOpen Then
                SQLiteConn.Open
        End If

Will try that in a bit. Still, the connection gets closed and opened all the
time with the same routine and no problem at all, except for in that shown
code fragment. The error originates from the wrapper and it is says the
source is the connection object. Unfortunately the help file doesn't help.

RBS

-----Original Message-----
From: Kees Nuyt [mailto:[EMAIL PROTECTED] 
Sent: 10 December 2006 00:44
To: sqlite-users@sqlite.org
Subject: Re: [sqlite] Operation is not allowed when the object is closed

On Sat, 9 Dec 2006 23:38:47 -0000, you wrote:

>   On Error Resume Next
>   Do While SQLiteConn.State = slStateClosed
>      SQLiteConn.Open
>   Loop

I has been quite some time since I wrote VB, but I'll give it a
try.  
You seem to assume that SQLiteConn.Open raises an error when it
fails. 
If it doesn't raise an VBerror, you don't detect something is
wrong. SQLiteConn.State will not equal slStateClosed but the
error status, so the loops ends and you stop trying to open,
without having opened the database.

HTH
-- 
  (  Kees Nuyt
  )
c[_]

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




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

Reply via email to