- Founder/Site Admin
- Posts: 3218
- Joined: 24 Feb 2017, 09:12
- Location: Gouda, The Netherlands
and also here:
https://samples.tdcommunity.net/index.p ... rch_mode=f
Maybe a start...
Here a full article on how to use Sqlite in TD:
https://wiki.tdcommunity.net/index.php/ ... plications
Hello Michael,mike_fortytwo wrote:As an alternative, you could use SQLite with ODBC. For example
But I've no experience with SQLite connections from ODBC.
I already had the same idea and tested the ODBC Driver a little bit. In general the Driver is working but I found some confusing things!
I have a table with a field that is defined as "INTEGER NOT NULL AUTOINCREMENT". When receiving data the value that is returned for this field is of type "LONG STRING".
Another thing is that the application is not using the database file that has been defined in the ODBC settings! It looks somewhere else for the .db file and I have no idea why this is the case!
So in the moment therer are some things that are not logical But I will go on with my tests.
I've checked it with a sample and for me it runs fine?!
In my test environment, I've TD 6.3 SP1 running on Windows 7 with the current ODBC driver from http://www.ch-werner.de/sqliteodbc/. The SQLite version is 3.9.2.
My table definition looks like:
Code: Select all
create table product ( STYLE_ID integer primary key autoincrement not null, STYLE varchar(30), DESCRIPTION varchar(254), PRICE decimal(8, 2), URL varchar(128), PROD_LINE_ID integer, PICTURE blob, PICTURE_SAL_TYPE integer );
The sourcecode, to get the information from the table looks like:
Code: Select all
Function: SelectProduct Local variables String: sSql Number: nStyleId String: sStyle Number: nFetch Actions Set sSql = "select style_id, style from product2 into :nStyleId, :sStyle" If SqlPrepareAndExecute( hSql, sSql ) If SqlFetchNext( hSql, nFetch ) Call SalMessageBox("Style ID: " || SalNumberToStrX( nStyleId, 0 ) || " - Style: " || sStyle, "Select", MB_Ok )
Who is online
Users browsing this forum: [Ccbot] and 0 guests