Using Database without ODBC

All topics on the Atoms in any Enterprise Dynamics Library.
LAC-Bursi
Posts: 41
Joined: Friday 09 November, 2012 - 10:37

Using Database without ODBC

Post 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
BartC
Posts: 47
Joined: Monday 05 November, 2012 - 17:05

Re: Using Database without ODBC

Post 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
LAC-Bursi
Posts: 41
Joined: Friday 09 November, 2012 - 10:37

Re: Using Database without ODBC

Post 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
LAC-Bursi
Posts: 41
Joined: Friday 09 November, 2012 - 10:37

Re: Using Database without ODBC

Post by LAC-Bursi »

Have you an example?
User avatar
MatthijsJongboer
Posts: 200
Joined: Thursday 11 November, 2010 - 14:12

Re: Using Database without ODBC

Post 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).
LAC-Bursi
Posts: 41
Joined: Friday 09 November, 2012 - 10:37

Re: Using Database without ODBC

Post 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
LAC-Bursi
Posts: 41
Joined: Friday 09 November, 2012 - 10:37

Re: Using Database without ODBC

Post by LAC-Bursi »

Why?

Which errors I do?

Fabio
User avatar
MatthijsJongboer
Posts: 200
Joined: Thursday 11 November, 2010 - 14:12

Re: Using Database without ODBC

Post 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
LAC-Bursi
Posts: 41
Joined: Friday 09 November, 2012 - 10:37

Re: Using Database without ODBC

Post by LAC-Bursi »

This is the table STUDENTE of my database TestDB:

Image
LAC-Bursi
Posts: 41
Joined: Friday 09 November, 2012 - 10:37

Re: Using Database without ODBC

Post by LAC-Bursi »

Could you make an example using this table?
Post Reply