can't connect to sqlite 3 database ?

Forum related to SQLite

Moderators: gto, cipto_kh, EgonHugeist

Post Reply
domi.papin
Fresh Boarder
Fresh Boarder
Posts: 13
Joined: 12.09.2006, 11:15

can't connect to sqlite 3 database ?

Post by domi.papin »

hello,

I'm trying to connect to a sqlite3 databse through zeos component. I have copied sqlite3.dll of sqlite.org in my app dir. Then I've renamed it sqlite.dll.
I've affected the protocol property of ZConnection with 'sqlite'. the app compiles but raises an exception reading a nil address during connection.

Before trying to debug, I wanted to ask for help. Am I missing something ?
By the way, I've tried with success to access my database with sqliteadmin. Then, I'm little frustrated as I know it is made around zeos component.

Dominique
dragondz
Fresh Boarder
Fresh Boarder
Posts: 14
Joined: 29.03.2006, 10:54
Location: Algiers, Algeria
Contact:

Post by dragondz »

Wich zeos lib you use?

I use SVN Zeoslib and it works fine with sqlite3 (without renaming the dll)
domi.papin
Fresh Boarder
Fresh Boarder
Posts: 13
Joined: 12.09.2006, 11:15

Post by domi.papin »

I use Svn testing branch of zeos.
If I don't rename the dll, zeos complains that it can't find sqlite.dll
domi.papin
Fresh Boarder
Fresh Boarder
Posts: 13
Joined: 12.09.2006, 11:15

Post by domi.papin »

Ok, I've figured that I should affect 'sqlite-3' to protocol.
Now it connects.

Second Step, I call ZConnect.GetTableNames but the function returns a zero count list. During a debug step, I copied the SQL string generated by GetTableNames and tried it under SQLite Administrator and ..... it works. Let's see if i can find the light :-)
domi.papin
Fresh Boarder
Fresh Boarder
Posts: 13
Joined: 12.09.2006, 11:15

Post by domi.papin »

More details :
ZConnect.GetTableNames always return a zero count list.
If I tried this 'SELECT TBL_NAME as TABLE_NAME FROM SQLITE_MASTER' with TZQuery then it also returns a zero count set.

It seems to me that I'm lost there 8-|
domi.papin
Fresh Boarder
Fresh Boarder
Posts: 13
Joined: 12.09.2006, 11:15

Post by domi.papin »

I didn't manage to make GetTableNames work. Instead, I've used TZMetadata components and it gives correct table names.

I haven't got time now to investigate on ZConnection.GetTableNames. hope I will take a closer look later.
Post Reply