• Welcome to SQLitening Support Forum.
 

News:

Welcome to the SQLitening support forums!

Main Menu

Server Hugs Database

Started by Fredrick Ughimi, December 01, 2007, 11:54:43 AM

Previous topic - Next topic

Fredrick Ughimi

Hello Paul,

I have been trying out SQLite Client / Server for about two days.

I can connect to the server, add records, etc. The problem is that each time
I want to view the entered records using Sqlite Expert Personal or any other tool I get "the database file is
locked". I would  have to stop the server manually before I can view the records.
I thought sql3_disconnect gSession would do that.

Am I missing something?  ???

Best regards,
Fredrick O. Ughimi<br /><br />fughimi@gmail.com<br />- Freedom lies in being bold -- Robert Frost, Poet

Paul Squires

Hi Fredrick,

The Server is holding the database handle open (it closes all handles when the server shuts down). I will modify the code to close the handle when the connection is done with it.

Paul Squires <br />http://www.planetsquires.com<br />support@planetsquires.com

Paul Squires

Actually, I just tried a test withe Sqlite Expert Personal and I don't get a locking error????
Paul Squires <br />http://www.planetsquires.com<br />support@planetsquires.com

Fredrick Ughimi

Hello Paul,

>>Actually, I just tried a test withe Sqlite Expert Personal and I don't get a locking error?

Hmm.... strange. Its still locked here. I used Sqlite Expert Personal  to create the DB and table. Here is my code snippet:


sDatabase = "BankPro.db3"
    If Dir$(sDatabase) > "" Then Kill sDatabase

   
    '//  START A SESSION (creates the gSession memory)                                         
     errcode = sql3_StartSession(gSession, %False)
     
    sData = "SERVER = localhost; PORT = default; UID=PSS234; PASSWORD=MyPassword"
   
    errcode = sql3_connect( gSession, sData )
    If errcode Then
       MsgBox "Error" & Str$(errcode) & " trying to connect to server."
    End If   
   
errcode = sql3_Use( gSession, sDatabase, %SQL3_REMOTE)
If errcode Then
   MsgBox "Error" & Str$(errcode) & " trying to use database."
End If   
Fredrick O. Ughimi<br /><br />fughimi@gmail.com<br />- Freedom lies in being bold -- Robert Frost, Poet

Fredrick Ughimi

Hello Paul,

You are right Paul, only when you use codes to create your table.

I tried a different scenerio and it worked differently.

I discovered that the Server hugs the Database when the table is created
using SQLite Expert Personal or any other tool. But if the table is
created using codes the huging never occurs.

Hmm...

Best regards,

Fredrick O. Ughimi<br /><br />fughimi@gmail.com<br />- Freedom lies in being bold -- Robert Frost, Poet