SQLite Broken

Everything else that doesn't fall into one of the other PB categories.
chris319
Enthusiast
Enthusiast
Posts: 782
Joined: Mon Oct 24, 2005 1:05 pm

SQLite Broken

Post by chris319 »

This code used to work in 3.94:

Code: Select all

dbh = SQLiteOpen("ndx.db")
It now returns the error "Bad parameter type, number expected instead of a string".

Anyone?
User avatar
Fangbeast
PureBasic Protozoa
PureBasic Protozoa
Posts: 4789
Joined: Fri Apr 25, 2003 3:08 pm
Location: Not Sydney!!! (Bad water, no goats)

Post by Fangbeast »

You are using somebody's wrapper for Sqlite (a third party lib, not pb commands) and PB's syntax has changed a bit between versions so you have to find out who wrote the wrapper and ask them to fix it.

Personally, I never use wrappers because this is what happens and you have no control over it. El_Choni made a warapper but he also wrote some code to directly access the sqlite dll so that we don't have this problem and I am using his code without change on all pb versions.

You might want to see if he, Kiffi or Num3 did the wrapper (More likely Kiffi) and check PureAre.net for an update.
Amateur Radio/VK3HAF, (D-STAR/DMR and more), Arduino, ESP32, Coding, Crochet
chris319
Enthusiast
Enthusiast
Posts: 782
Joined: Mon Oct 24, 2005 1:05 pm

Post by chris319 »

You are using somebody's wrapper for Sqlite (a third party lib, not pb commands) and PB's syntax has changed a bit between versions
This is not a syntactical error, but it is El Choni's SQLite interface code. Which El Choni code are you using without modification? Would you mind sharing some examples?
User avatar
ts-soft
Always Here
Always Here
Posts: 5756
Joined: Thu Jun 24, 2004 2:44 pm
Location: Berlin - Germany

Post by ts-soft »

change this

Code: Select all

dbh = SQLiteOpen("ndx.db")
to this:

Code: Select all

dbh = SQLiteOpen(@"ndx.db")
Not tested, but should work
PureBasic 5.73 | SpiderBasic 2.30 | Windows 10 Pro (x64) | Linux Mint 20.1 (x64)
Old bugs good, new bugs bad! Updates are evil: might fix old bugs and introduce no new ones.
Image
chris319
Enthusiast
Enthusiast
Posts: 782
Joined: Mon Oct 24, 2005 1:05 pm

Post by chris319 »

That fixed it! Thanks!
USCode
Addict
Addict
Posts: 923
Joined: Wed Mar 24, 2004 11:04 pm
Location: Seattle

Post by USCode »

Can someone point me to where I could download El_Choni's SQLite3 wrapper?
El_Choni
TailBite Expert
TailBite Expert
Posts: 1007
Joined: Fri Apr 25, 2003 6:09 pm
Location: Spain

Post by El_Choni »

I don't think such a thing exists.
El_Choni
dmoc
Enthusiast
Enthusiast
Posts: 739
Joined: Sat Apr 26, 2003 12:40 am

Post by dmoc »

How would u know! :P
USCode
Addict
Addict
Posts: 923
Joined: Wed Mar 24, 2004 11:04 pm
Location: Seattle

Post by USCode »

El_Choni wrote:I don't think such a thing exists.
I guess you would know! I thought I read you'd written a wrapper but I guess that was just for the previous version of SQLite... thanks anyways.
El_Choni
TailBite Expert
TailBite Expert
Posts: 1007
Joined: Fri Apr 25, 2003 6:09 pm
Location: Spain

Post by El_Choni »

I read somewhere that there's a wrapper for Sqlite3 done by Kiffi, but I'm not sure. Mine is for Sqlite2, that's sure.
El_Choni
User avatar
Fangbeast
PureBasic Protozoa
PureBasic Protozoa
Posts: 4789
Joined: Fri Apr 25, 2003 3:08 pm
Location: Not Sydney!!! (Bad water, no goats)

Post by Fangbeast »

For Kiffi's wrapper, visit purearea.net. He made a wrapper for SQLite3.x and he also contributed it to the PBOSL project.

El_Choni, you are a dead set legend. I am still using your wrapperless code. Works a treat on everything and never breaks between compiler versions. Much betetr than a wrapper (shudders)
Amateur Radio/VK3HAF, (D-STAR/DMR and more), Arduino, ESP32, Coding, Crochet
USCode
Addict
Addict
Posts: 923
Joined: Wed Mar 24, 2004 11:04 pm
Location: Seattle

Post by USCode »

Fangbeast wrote:...El_Choni, you are a dead set legend. I am still using your wrapperless code. Works a treat on everything and never breaks between compiler versions. Much betetr than a wrapper (shudders)
El_Choni, how about a version then for SQLite3??? Please??? :D
El_Choni
TailBite Expert
TailBite Expert
Posts: 1007
Joined: Fri Apr 25, 2003 6:09 pm
Location: Spain

Post by El_Choni »

I suggest that you try Kiffi's' wrapper first... ;) No need to reinvent the wheel. Fangles refers to some code I wrote for sqlite3 without wrappers, using the sqlite functions directly.
El_Choni
USCode
Addict
Addict
Posts: 923
Joined: Wed Mar 24, 2004 11:04 pm
Location: Seattle

Post by USCode »

El_Choni wrote:I suggest that you try Kiffi's' wrapper first... ;) No need to reinvent the wheel. Fangles refers to some code I wrote for sqlite3 without wrappers, using the sqlite functions directly.
You mean "sqlite2", right?
Dare2
Moderator
Moderator
Posts: 3321
Joined: Sat Dec 27, 2003 3:55 am
Location: Great Southern Land

Post by Dare2 »

El_Choni wrote:I don't think such a thing exists.
dmoc wrote:How would u know! :P
:D
@}--`--,-- A rose by any other name ..
Post Reply