Page 1 of 2

Using Database without ODBC

Posted: Thursday 07 February, 2013 - 11:49
by LAC-Bursi
Hi,
I would like to know if I can read and write into database without instantiating ODBC.

I would prefer to use SQLite as database.

Thanks for your commitment

Fabio

Re: Using Database without ODBC

Posted: Thursday 07 February, 2013 - 12:29
by BartC
Hello Fabio,

If you take a look in the section Help --> Quickstart, you see a "Quickstart guide to ADO (PDF)". I would suggest that you read this quickstart guide and use the ADO functions to connect to your database.

Regards,

Bart

Re: Using Database without ODBC

Posted: Friday 08 February, 2013 - 11:26
by LAC-Bursi
Now I have my database: TestDB.db (create using SQLite Express), How I can connect the DB with one ED project?

Where should I find the Data Link Proprieties?

Where should I write the connection string?

Thanks!!

Fabio

Re: Using Database without ODBC

Posted: Friday 08 February, 2013 - 16:17
by LAC-Bursi
Have you an example?

Re: Using Database without ODBC

Posted: Friday 08 February, 2013 - 17:18
by MatthijsJongboer
Hi Fabio,

What you then need to do is to get a SQLite OLE DB Provider. There seem to be more versions available.
I found one here: http://cherrycitysoftware.com/ccs/Provi ... QLite.aspx
When you have it installed you can build a connectionstring that looks something like:

Code: Select all

Provider=OleSQLite.SQLiteSource;Data Source=Path\To\TestDB.db
When the link works, and you can perform operations on the database, you can include it in your model (e.g. on reset or when you need to make the connection).

Re: Using Database without ODBC

Posted: Monday 11 February, 2013 - 11:33
by LAC-Bursi
This is my code:

Code: Select all

 ADOConnect([Provider=OleSQLite.SQLiteSource;Data Source=C:\Program Files (x86)\Enterprise Dynamics 8 Developer\Work\TestDB.db]),
 ADOSetTable([Studente]),
 ADOSetQuery([Select * from Studente]),
 test := string(ADOReadQuery(2,2)),
 
 msg(test),

 ADOClose
and I always get this msg:

Image

Re: Using Database without ODBC

Posted: Monday 11 February, 2013 - 11:35
by LAC-Bursi
Why?

Which errors I do?

Fabio

Re: Using Database without ODBC

Posted: Monday 11 February, 2013 - 11:43
by MatthijsJongboer
Hello Fabio,
There could be many reasons for this to occur.
Perhaps you can post a small example database here that can be used for reproduction?

Matthijs

Re: Using Database without ODBC

Posted: Monday 11 February, 2013 - 11:54
by LAC-Bursi
This is the table STUDENTE of my database TestDB:

Image

Re: Using Database without ODBC

Posted: Tuesday 12 February, 2013 - 11:01
by LAC-Bursi
Could you make an example using this table?