View previous topic :: View next topic |
Author |
Message |
Mathos
Joined: 21 Dec 2005 Posts: 9
|
Posted: Wed Dec 21, 2005 22:55 Post subject: Problem setting up |
|
|
I recently tried to set up the NWNx database for SQLite. I followed the instructions that came with the download, but when i load the test module and try the different signs it says the following:
when i create the table in the database, it's succesfull according to the feedback in the game. There is no table in my database though
when i insert data into the table, it says it succeeded. There is no data.
when i retrieve the data from the tabl with the third sign it says it retrieved the string ".................................................................." Actualy it's even more dots. (this is the string for the database communications memory buffer, right?)
i adjusted the nwnx.ini file to refer to split.db, which is in my NWN folder. I created this file with SQLiteCC. When i put an empty nwnx.txt in my log.0 folder it remains empty.
nwnx_odbc.dll is in my nwn folder, Modified: Wednesday, February 02, 2005, 8:45:40 PM
my nwnx.ini file looks like this:
; NWNX2 ODBC2 example configuration file
; Copy the contents of this file to your nwnx.ini file and
; edit the parameters accordingly !
[ODBC2]
; Log file
MaxLogSize = 512 ; in KByte
LogLevel = 2 ; 0=nothing, 1=only errors, 2=everything
; Use these two settings for the SQLite internal database
source = SQLite
file = split.db
; Use these two settings for ODBC connections
;source = odbc
;dsn = nwn
; Use these five settings for MySQL connections
;source = mysql
;server = localhost
;user = nwn
;pwd = nwn
;db = nwn
; Set hookscorco to false if you want to disable hooking of
; StoreCampaignObject and RetrieveCampaignObject entirely
hookscorco = true
I also tried to code some SQL myself in a script in my own module. I execute an SQL select statement with the SQLExecDirect function from an empty table. The SQLFetch statement returns SQL_SUCCESS even though threre are no records....
this is all the info i could think of typing.... Could you help me out, i'm in the dark here... |
|
Back to top |
|
|
Acrodania
Joined: 02 Jan 2005 Posts: 208
|
Posted: Thu Dec 22, 2005 0:00 Post subject: |
|
|
What are the contents of the ODBC.LOG file? It will actually give the success or errors when the command is executed...... |
|
Back to top |
|
|
Mathos
Joined: 21 Dec 2005 Posts: 9
|
Posted: Thu Dec 22, 2005 13:33 Post subject: |
|
|
Where would i find this file?
I created an empty odbc.log and odbc.txt in the logs.0 folder, but they remain empty when i try the mod. When i perform a search i only find the files i created so the files don't exist anywhere else on my disks. |
|
Back to top |
|
|
Mathos
Joined: 21 Dec 2005 Posts: 9
|
Posted: Thu Dec 22, 2005 13:39 Post subject: |
|
|
I also tried to put them in the logs folder... same result. |
|
Back to top |
|
|
Acrodania
Joined: 02 Jan 2005 Posts: 208
|
Posted: Thu Dec 22, 2005 17:02 Post subject: |
|
|
The ODBC log file is created automatically when NWNX is started.
How are you starting your module? Are you running the NWNX2.EXE file or by some other method? It sounds like you are just starting NWServer or starting the module from inside NWN; to use NWNX you HAVE to start the module through NWNX..... |
|
Back to top |
|
|
Mathos
Joined: 21 Dec 2005 Posts: 9
|
Posted: Thu Dec 22, 2005 17:30 Post subject: |
|
|
*slaps forehead* stupid stupid stupid That's it! Thanks, it's working now |
|
Back to top |
|
|
Mathos
Joined: 21 Dec 2005 Posts: 9
|
Posted: Thu Dec 22, 2005 18:00 Post subject: |
|
|
It's working like a charm. I stored values and retrieved them
It only worked with the database generated by NWNX though. If i create a database with SQLiteCC, the odbc log says it can't connect because it's not a database or the database is encrypted.
If i let NWNX create the database, i can't open it with SQLiteCC because it crashes on me. Should i use another version of SQLiteCC? I have v0.06. Or is there maybe another tool i can access the database with? |
|
Back to top |
|
|
Acrodania
Joined: 02 Jan 2005 Posts: 208
|
Posted: Fri Dec 23, 2005 0:24 Post subject: |
|
|
The dlls and such that are packed with NWNX use SQLite version 3.0.8 Its possible that SQLiteCC is making the database as a different version...
Do you have the SQLite3.exe file for the 3.0.8 version? If so you can use that to make the database via a command line, if not you can download it from my site:
http://nurrana.radcon.org/Downloads/sqlite.zip
The download includes the command line utility, the correct DLLs to match it and a functional sqlite database file.
Once you have made the database via the command line, SQLiteCC will correctly edit it and make changes while maintaining the original compatibility.... |
|
Back to top |
|
|
Mathos
Joined: 21 Dec 2005 Posts: 9
|
Posted: Fri Dec 23, 2005 16:59 Post subject: |
|
|
I downloaded your version. If i extract all the contents to a folder, open the sqlite.db with the sqlite3.exe command prompt tool and execute a select statement on the sqlite_master table i get the following message:
http://img493.imageshack.us/img493/8379/sqlite2xz.jpg
I did not open the sqlite.db file in the zip in SQLiteCC yet, so i guess the database in the zip file is from a newer version than the sqlite3.exe. SQLiteCC will open the file without problems though. |
|
Back to top |
|
|
Mathos
Joined: 21 Dec 2005 Posts: 9
|
|
Back to top |
|
|
Acrodania
Joined: 02 Jan 2005 Posts: 208
|
Posted: Fri Dec 23, 2005 19:03 Post subject: |
|
|
Yes, but not where I can get to it right now
Try the "SQLite Database Browser" version 1.2 |
|
Back to top |
|
|
Mathos
Joined: 21 Dec 2005 Posts: 9
|
Posted: Fri Dec 23, 2005 20:25 Post subject: |
|
|
I searched on this forum some more and found a link to this site: http://home.student.uu.se/frax0795/ and there it was... the correct SQLiteCC version (Here's a direct link to the download: http://home.student.uu.se/frax0795/sqlitecc-api3-exe.zip).
I made database with this SQLiteCC and i could use it in the SQLite3.exe v3.0.8 and vice versa. I also tried the database i made with SQLiteCC with my module. It worked! All the tools i need are there...
Thanks for the quick help!
PS. Maybe you should put this SQLiteCC version amongst your own downloads (If that's legal, which i think it is because it's freeware, right?) |
|
Back to top |
|
|
Mathos
Joined: 21 Dec 2005 Posts: 9
|
Posted: Fri Dec 23, 2005 21:29 Post subject: |
|
|
Oh... and be carfull with rolling back transactions in SQLiteCC. I created a table in a transaction and then executed a rollback. The table will still show in the table list, but when you select it, SQLiteCC crashes.... |
|
Back to top |
|
|
Papillon x-man
Joined: 28 Dec 2004 Posts: 1060 Location: Germany
|
Posted: Sat Dec 24, 2005 18:47 Post subject: |
|
|
The right version is linked in the NWNX: Links section. Maybe that should be pointed out in the documentation... _________________ Papillon |
|
Back to top |
|
|
Papillon x-man
Joined: 28 Dec 2004 Posts: 1060 Location: Germany
|
Posted: Sat Dec 24, 2005 18:49 Post subject: |
|
|
Actually, it IS mentioned in the documentation... don't you guys ever read the manual ? _________________ Papillon |
|
Back to top |
|
|
|