Frequent Contributor.
Frequent Contributor.
145 views

Access to SQLite with AcuCobol 9.2

I would like to write in SQLite with AcuCobol 9.2.5 and use sqlite3.dll. Is it possible and when yes, where can I find an example?

Thank you in advance.
Werner

0 Likes
15 Replies
Highlighted
Outstanding Contributor.
Outstanding Contributor.

Betreff: Access to SQLite with AcuCobol 9.2

For mssql you can use this code, for sqllite may be the same, only the connectstring must be other:

see zip-file

 

0 Likes
Highlighted
Outstanding Contributor.
Outstanding Contributor.

Betreff: Access to SQLite with AcuCobol 9.2

For Ms-access the connectring can be:
move 'ODBC;DSN=msaccess;database=FDARTSTA;Uid=Admin;Pwd;' to sql-connectstring

SQLITE is nearly the same!
0 Likes
Highlighted
Outstanding Contributor.
Outstanding Contributor.

Betreff: Access to SQLite with AcuCobol 9.2

Here you can find all informations you Need:
https://sqlite.org/index.html
0 Likes
Highlighted
Frequent Contributor.
Frequent Contributor.

Betreff: Access to SQLite with AcuCobol 9.2

Vielen Dank für die Antwort und die Datei. Ich werde diese morgen testen.

In einem Beitrag habe ich diesen Ansatz über die sqlite3.dll gefunden und eingebaut:
call "sqlite3_exec" using by value sqlite3-db
by reference sqlQuery
by value 0
by value 0
by reference err-msg
returning RC
end-call.

Das Schreiben in die SQlite-DB-Tabelle und das Löschen der Daten funktioniert so. Nur Retour-Werte kann ich nicht auswerten. Offenbar funktioniert dieser Aufruf nur in eine Richtung.

0 Likes
Highlighted
Outstanding Contributor.
Outstanding Contributor.

Betreff: Access to SQLite with AcuCobol 9.2

Hi Werner,

you must become the result code (RC) in the field RC, rc=0 will be succesfull, otherwise error.

you must call to begin of your Programm: call "sqlite3.dll"

Can you share your Little program, i have many time and will help you to include all SQL possibilities as for other database as mssql, mysql, Oracle, db2 and other.

Thank you for giving us the possibility to help you and the community

 

0 Likes
Highlighted
Frequent Contributor.
Frequent Contributor.

Betreff: Access to SQLite with AcuCobol 9.2

writing works well, also delete, open and close. Just reading ist not possible.

I don't get a return and RC is not zero. I think the data types are wrong with USING BY. I also do not recognize in which field / table the return values ​​would be output.

0 Likes
Highlighted
Outstanding Contributor.
Outstanding Contributor.

Betreff: Access to SQLite with AcuCobol 9.2

here a example to read a database with mssql (see attachment)

 

0 Likes
Highlighted
Outstanding Contributor.
Outstanding Contributor.

Betreff: Access to SQLite with AcuCobol 9.2

Achtung! Attention!
with "sqlite3_exec" there will be a procedure that is call, this is possible with all database and you must know what is describe in this _exec!
0 Likes
Highlighted
Frequent Contributor.
Frequent Contributor.

Betreff: Access to SQLite with AcuCobol 9.2

Thank you very much. How can I use this code in AcuCobol 9.2?

EXEC SQL doesn't work

Du you have a complete sample I can test in AcuBench, please?

0 Likes
Highlighted
Outstanding Contributor.
Outstanding Contributor.

Betreff: Access to SQLite with AcuCobol 9.2

Werner, it exist a odbc Driver for sqlite and then you can use normal SQL commands,

see https://www.devart.com/odbc/sqlite/download.html

 

0 Likes
Highlighted
Outstanding Contributor.
Outstanding Contributor.

Betreff: Access to SQLite with AcuCobol 9.2

Werner, i have a running Version with full functionality via odbc driver, here a possible connectstring:
Driver=Devart ODBC Driver for SQLite;Database=p:\cobol\sqlite\sqlite3.db;LongNames=0;Timeout=1000;NoTXN=0;SyncPragma=NORMAL;StepAPI=0;Force Create Database=True;
This must run with acucobol, my example run with netexpress 5.x and Visual Cobol 5.x
0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.