April 20, 2024, 01:30:00 AM

News:

Own IWBasic 2.x ? -----> Get your free upgrade to 3.x now.........


SQLite3 and IWB

Started by Columbo, March 19, 2015, 09:38:48 AM

Previous topic - Next topic

0 Members and 2 Guests are viewing this topic.

Columbo

Purebasic has SQLite3 built into it.  My understanding is that to use SQLite3 with IWB you need to add it as a .lib.  Where does one fine a SQLite.lib, or am I wrong on this?

Thanks.

LarryMc

As with any 3rd party dll you want to use with IWB you need to build the lib file.

Since I know you already have the sqlite.dll file all you need to  do from the IWB IDE is
from the Tools menu select Create Import Library
navigate to the desired dll and click open.
The lib file will be created and placed in the iwbdev\libs folder.
This is covered in the Help File in the following sections:
Utilities»Create Import Libraries
Language»Using DLL's and the Windows API

You will need an include file(*.inc) with all the IWB wrapper export function declarations for that dll .
Fortunately those and those for many other windows API's have been prepared by a former member and placed in a file called "windowssdk.inc".  To use it it is placed at the beginning of your programming thusly
$include "windowssdk.inc"
The installer can be downloaded from  here
It will install inc files and also automatically create lib files when it can and place them in heir proper places.

I have never used that dll. So any specific help I might can offer with that dll will be extremely limited.  All my database programming has been with IWB's ODBC interface which uses SQL commands.
LarryMc
Larry McCaughn :)
Author of IWB+, Custom Button Designer library, Custom Chart Designer library, Snippet Manager, IWGrid control library, LM_Image control library

Columbo

March 19, 2015, 04:30:39 PM #2 Last Edit: March 19, 2015, 05:00:56 PM by Columbo
Thank you very much Larry.  I'll also look into IWB's ODBC interface as well.

I downloaded the sqlite3.dll, went to the Tools>Create Import Library and tried to import it but it said file already exixts.  I then went into my Program Files>IWBdev3 and found that sqlite3.lib is included.  It must be something that was added to IWB version 3.


Brian

John,

I would have overwritten the old lib file with the output generated from your (probably) far newer sqlite3 dll

And then made sure the new sqlite3.dll was the only one on your PC

Brian

Columbo

Hi Brian,

Do you mean that you would have overwritten the sqlite.lib that is now included with IWB v3?

Also, to use the .lib file could you not just place $use "sqlite.lib" at the beginning of the file?

John

Brian

Well, the thing is, you are generating the lib file from YOUR sqlite DLL. Can't vouch for the version and age
Of the one with the IWB distro. Let's say I always like to use the latest versions!

Brian

Columbo

Ok, thanks Brian.  In terms of using the sqlite.lib could you not just place $use "sqlite.lib" at the beginning of the program file?

Brian

Well, I may get shot down in flames here, but I think if you just use a third party lib, you have to declare all your DLL calls at the start of your program, like DECLARE IMPORT, etc

And that's assuming you know all the calls, what they are named, what types to declare, etc

That's where the include files come in, because they are all set out in there, and you just $include the appropriate include file

Brian

LarryMc

Still flying high Brian  ;D
LarryMc
Larry McCaughn :)
Author of IWB+, Custom Button Designer library, Custom Chart Designer library, Snippet Manager, IWGrid control library, LM_Image control library

Brian

Glad about that, Larry!

We've had an eclipse here today, about 9 am. So last night I got my tripod out, put a sun filter on the camera lens, charged the camera batteries up, set the garden table up in the right position so I could set the tripod on it

It was cloudy! Wasted my time, although I got some good stills. I really wanted to take a video

Although I can think of worst ways to spend my time...

Brian