Discussions related to Visual Prolog
User avatar
drspro2
VIP Member
Posts: 97
Joined: 28 Apr 2006 12:03

Sqlite

Unread post by drspro2 »

hello forum,

I have noticed that Mozilla firefox, Thunderbird and Kmeleon all use Sqlite as a database.

it might be usefull if we could have an interface to the functions,

on this site: https://www.sqlite.org/download.html

they offer a dll zip download with a .def file and a dll file,

is this suited to use/import in Vip by use dll predicates or other predicates?,



thankyou,


R
User avatar
Thomas Linder Puls
VIP Member
Posts: 1398
Joined: 28 Feb 2000 0:01

Unread post by Thomas Linder Puls »

Since there is no LIB file you will have to load the DLL dynamically.

The simplest way is to define a class with the relevant (i.e. matching the C/C++ tryes) predicate declarations

Code: Select all

class sqlite domains     sqlite3 = ...   predicates     sqlit3_open16 : (string Filename, sqlite3 ppDb [out]) language c. ... end class sqlite
and then resolve them from the DLL:

Code: Select all

implement sqlite     resolve         sqlit3_open16 from "sqlite3.dll" ... end implement sqlite
See Foreign Language Code.
Regards Thomas Linder Puls
PDC
User avatar
drspro2
VIP Member
Posts: 97
Joined: 28 Apr 2006 12:03

Unread post by drspro2 »

great thankyou for the information, i will try this
Post Reply