TD 6.3 using sqlite

General discussion forum about all databases other than SqlBase.
Welskop

TD 6.3 using sqlite

Post by Welskop » 05 Nov 2015, 08:32

Hello together,

has somebody here used TD 6.3 to work with sqlite databases? If yes how did you implement this and what are your experiences with using sqlite as a database in connection with TD 6.3?

Frank

Dave Rabelink
Founder/Site Admin
Founder/Site Admin
Netherlands
Posts: 3207
Joined: 24 Feb 2017, 09:12
Location: Gouda, The Netherlands

Re: TD 6.3 using sqlite

Post by Dave Rabelink » 05 Nov 2015, 08:51

Personally I do not have experience with this, but you can find some stuff here:

https://wiki.tdcommunity.net/index.php?title=SQLite


and also here:

https://samples.tdcommunity.net/index.p ... rch_mode=f

Maybe a start...

/EDIT

Here a full article on how to use Sqlite in TD:

https://wiki.tdcommunity.net/index.php/ ... plications
Regards,
Dave Rabelink

Image
Articles and information on Team Developer Tips & Tricks Wiki
Download samples, documents and resources from TD Sample Vault
Videos on TDWiki YouTube Channel

mike_fortytwo

Re: TD 6.3 using sqlite

Post by mike_fortytwo » 09 Nov 2015, 11:21

As an alternative, you could use SQLite with ODBC. For example

http://www.ch-werner.de/sqliteodbc/

But I've no experience with SQLite connections from ODBC.

Michael

Welskop

Re: TD 6.3 using sqlite

Post by Welskop » 10 Nov 2015, 07:59

mike_fortytwo wrote:As an alternative, you could use SQLite with ODBC. For example

http://www.ch-werner.de/sqliteodbc/

But I've no experience with SQLite connections from ODBC.

Michael
Hello Michael,

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.

Frank

mike_fortytwo

Re: TD 6.3 using sqlite

Post by mike_fortytwo » 16 Nov 2015, 11:42

Hi Frank,

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
);
I've created an ODBC datasource with the 32-Bit ODBC-Datasource Administrator:
Unbenannt.PNG
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 )
The result I've get is correct. No SQLError, etc.

Michael
You do not have the required permissions to view the files attached to this post.

Return to “General Discussion”

Who is online

Users browsing this forum: No registered users and 0 guests