FNXBasic and SQLite3

In this category you can exchange your programming questions and solutions.
Post Reply
Willem
Posts: 1
Joined: Fri Apr 07, 2017 6:21 am

FNXBasic and SQLite3

Post: # 1274Post Willem
Fri Apr 07, 2017 6:23 am

Is it possible to access a SQLite3 database in FNXBasic? How do I do this?

Bob82604
Posts: 6
Joined: Fri Dec 30, 2016 10:30 pm

FNXBasic and SQLite3

Post: # 1275Post Bob82604
Fri Apr 07, 2017 5:28 pm

this might be of some help:

http://fnxbasic.com/cgi-bin/QandA/YaBB.pl?num=1326960009/1#1

pierrf
Posts: 3
Joined: Thu Jan 10, 2019 8:42 am

Re: FNXBasic and SQLite3

Post: # 1302Post pierrf
Fri Jan 11, 2019 8:09 am

The link mentioned above doesn't work.

I have the following problem with this piece of code:

dim db1 as integer
Declare sql3_open as "sqlite3_open" of "sqlite3.dll" cdecl
filename As String
db As integer
result as integer
end declare
with sql3_open
filename="data.db"
db1=db
execute
end with
print db1
print sql3_open.result

The data.db and sqlite3.dll files reside in the same folder as the program.
When I run the program, I get the following error message:

Runtime error at position 1953
Access violation at address 6091A24B in module 'sqlite3.dll'. Write of address 00000000

I get the same message if I declare the sub omitting 'cdecl'.
Any ideas?

Marco
Site Admin
Posts: 240
Joined: Sat Sep 15, 2018 8:41 pm

Re: FNXBasic and SQLite3

Post: # 1304Post Marco
Tue Jan 15, 2019 8:55 pm

The link is the old forum the new link is:
viewtopic.php?f=1&t=259

not tested but try something like this:

dim db1 as integer
Declare sql3open as "sqlite3_open" of "sqlite3.dll" cdecl
Pfilename As integer
db As integer
result as integer
end declare

dim filename as string
filename="data.db"+chr$(0)
sql3open.Pfilename=varptr(filename)
sql3open.db1=db
sql3open.execute

print db1
print sql3open.result

best regards

pierrf
Posts: 3
Joined: Thu Jan 10, 2019 8:42 am

Re: FNXBasic and SQLite3

Post: # 1305Post pierrf
Mon Jan 21, 2019 11:22 am

I think it should be:
sql3open.db=db1

The code suggested doesn't work either. I get the message:
Runtime error at position 1959
Access violation at address 6091A24B in module 'sqlite3.dll'. Write of address 00000000

The link you mentioned is only for ODBC/MsAccess, not sqlite.

Have you succesfully used sqlite3 with fnxbasic?

Thanks and best regards,
Frank

Post Reply