SQLite Wrapper Functions

Share your advanced PureBasic knowledge/code with the community.
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by El_Choni.

Sorry, I mean "create a database", of course you can create a table with the DLL. Sorry about the problems with 1.11. As Manolo said, I'm working on 1.3 to have those problems solved. In the meanwhile, you can download 1.2 which is like 1.11 but a bit more stable (I hope :wink:

http://www.terra.es/personal5/temporald/SQLite_1.2.zip

When I have a stable and working 1.3 version, I'll upload it to Paul's (maybe I uploaded 1.11 too fast, as you see, it has some bugs, sorry).

Bye,

El_Choni
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by ebknoppert.

I managed it to get it to work,

I did nothing wrong but the tool i used (not mine) didn't work correctly.

This tool will list the tables:
http://members.rogers.com/mbi/software/ ... _index.htm
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by El_Choni.

BTW, you can create a database just by opening an unexisting one.

Version 1.3 is being tested by my Beta Testing Team (hola, Manolo :wink:

El_Choni
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by dige.

El_Choni, what about the 1.3 version?
I'm curious about it! :))
Could I help some beta testing?

cya dige
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by Manolo.

Wait one more day pls

Manolo
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by KNS.

Forgive the extremely naive question, but will it be possible to visually create/initialize databases within a PB program, then extract the items non-interactively? Essentially, I'm looking for an easy way to enter data. From what I've read test.db was created using sqlite.


Thanks.
K
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by gnozal.

I have just downloaded sqlite_132.zip.
I am behind a stupid firewall/antivirus :) wich removed SQLiteBuild.bat from the file.
Can someone please post the content of the SQLiteBuild.bat file ?
Thanks.
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by El_Choni.

Here:

Code: Select all

@echo OFF

..\..\Compilers\NAsm.exe -fwin32 Functions\InitSQLite.asm
..\..\Compilers\NAsm.exe -fwin32 Functions\InitSQLite2.asm
..\..\Compilers\NAsm.exe -fwin32 Functions\IsSQLiteActive.asm
..\..\Compilers\NAsm.exe -fwin32 Functions\SQLiteClose.asm
..\..\Compilers\NAsm.exe -fwin32 Functions\SQLiteCols.asm
..\..\Compilers\NAsm.exe -fwin32 Functions\SQLiteData.asm
..\..\Compilers\NAsm.exe -fwin32 Functions\SQLiteData2.asm
..\..\Compilers\NAsm.exe -fwin32 Functions\SQLiteEnd.asm
..\..\Compilers\NAsm.exe -fwin32 Functions\SQLiteError.asm
..\..\Compilers\NAsm.exe -fwin32 Functions\SQLiteError2.asm
..\..\Compilers\NAsm.exe -fwin32 Functions\SQLiteErrorString.asm
..\..\Compilers\NAsm.exe -fwin32 Functions\SQLiteExec.asm
..\..\Compilers\NAsm.exe -fwin32 Functions\SQLiteFinish.asm
..\..\Compilers\NAsm.exe -fwin32 Functions\SQLiteFreeTable.asm
..\..\Compilers\NAsm.exe -fwin32 Functions\SQLiteGetTable.asm
..\..\Compilers\NAsm.exe -fwin32 Functions\SQLiteGetTablePointer.asm
..\..\Compilers\NAsm.exe -fwin32 Functions\SQLiteID.asm
..\..\Compilers\NAsm.exe -fwin32 Functions\SQLiteInit.asm
..\..\Compilers\NAsm.exe -fwin32 Functions\SQLiteInterrupt.asm
..\..\Compilers\NAsm.exe -fwin32 Functions\SQLiteLastInsertedRow.asm
..\..\Compilers\NAsm.exe -fwin32 Functions\SQLiteLibVersion.asm
..\..\Compilers\NAsm.exe -fwin32 Functions\SQLiteOpen.asm
..\..\Compilers\NAsm.exe -fwin32 Functions\SQLiteRemoveData.asm
..\..\Compilers\NAsm.exe -fwin32 Functions\SQLiteRows.asm
..\..\Compilers\NAsm.exe -fwin32 Functions\SQLiteRowsChanged.asm
..\..\Compilers\NAsm.exe -fwin32 Functions\SQLiteShared.asm
..\..\Compilers\NAsm.exe -fwin32 Functions\SQLiteUseDB.asm
..\..\Compilers\NAsm.exe -fwin32 Functions\SQLiteUseTable.asm
..\..\Compilers\NAsm.exe -fwin32 Functions\Shared\SQFindHandle.asm
..\..\Compilers\NAsm.exe -fwin32 Functions\Shared\SQMemoryAllocate.asm
..\..\Compilers\NAsm.exe -fwin32 Functions\Shared\SQSetLibError.asm

"..\..\Library SDK\lcclib.exe" /out:SQLite.lib @SQLiteObjFiles.txt
Del Functions\*.obj
Del Functions\Shared\*.obj
pause
Note: you need NAsm.exe in Compilers/ and lcclib.exe in Library SDK/. I've seen that NAsm.exe is no longer in the compilers directory, so either you have a copy somewhere esle and you copy it to the Compilers/ directory, either you download it from http://nasm.sourceforge.net. I'll translate the code to Fasm ASAP, so you don't need Nasm any more to build the lib.

Bye,

El_Choni
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by El_Choni.

@KNS: yes, creating a db is as easy as opening a database that does not exist (in that case, SQLite.dll creates it). That's what the example file does, after that it creates a table and fills it with some data.

El_Choni
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by gnozal.

Thank you !
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by dige.

Hi El_Choni,

what does it means: 'error 21' library routine called out of sequence
I get this message sometimes using the SQLib 1.32.
Do you have an idea?

cya dige
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by El_Choni.

Can you send or post some code to reproduce that? TIA

El_Choni
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by KNS.

El_Choni,

Thanks for the reply. A refined version of my question would be, is there a grid/table object, like Excel, that can be used to facilitate data entry once the table has been created? I've only recently purchased PureBasic and have not had the opportunity to explore other than browsing the various examples I've found in these forums. Unfortunately, I have yet to encounter any snippets that incorporate a grid-like object for interacting with data. If this is possible a pointer would be much appreciated.

(I'll also take a closer look at your example file.)

Thanks,
K
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by CoderLaureate.

Try the icon list gadget.

There may be something better, but, this is the method I've found that works for me.

-Jim

---------------------------------------------
AMD Duron 950Mhz/Windows XP Pro
http://www.BlueFireStudios.com
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by effigy.

EBS Mentioned that he used EasySQLite to access data. It's a great program for veiwing SQLite databases.

You do however need to know a bit of SQL to work it, but the Help file has some very usefull examples.

Check it out at http://jansfreeware.com/

Derek

BTW I love the SQLite Dll and the great little database program that
it accesses. Thanks so much guys for bringing it to Purebasic.
Post Reply