Unidac sqlite
Unidac sqlite
Hi All,
I need to use a sqlite database with unidac.
What I would like is
1. Code example to create a database and save that to the hard drive (not just a memory one)
2. The correct sqlite3.dll touse.
I keep having crashes with the dll's I have tested.
The sqlie3.dll is placed in the exe folder.
I am using Delphi 7
Thanks in advance
Tom Duncan
I need to use a sqlite database with unidac.
What I would like is
1. Code example to create a database and save that to the hard drive (not just a memory one)
2. The correct sqlite3.dll touse.
I keep having crashes with the dll's I have tested.
The sqlie3.dll is placed in the exe folder.
I am using Delphi 7
Thanks in advance
Tom Duncan
Re: Unidac sqlite
1. The detailed information about database creation and connection using UniDAC is provided in our documentation: https://www.devart.com/unidac/docs/?basics.htm . Use a small console application as demo sample:
or learn our demo sample: [ UniDAC Install folder ]\Demos\UniDacDemo\UniDacDemo.dpr
2. You can download the SQLITE3.DLL client library from the official website: http://www.sqlite.org/download.html
Code: Select all
program Project1;
{$APPTYPE CONSOLE}
{$R *.res}
uses
System.SysUtils, Uni, UniProvider, SQLiteUniProvider;
var UniConnection: TUniConnection;
begin
UniConnection := TUniConnection.Create(Nil);
try
UniConnection.ProviderName := 'SQLITE';
UniConnection.SpecificOptions.Values['Direct'] := 'True';
UniConnection.SpecificOptions.Values['ForceCreateDataBase'] := 'True';
UniConnection.DataBase := '< your SQLite DB Name >';
UniConnection.Connect;
WriteLn('DataBase created !');
ReadLn;
finally
UniConnection.Free;
end;
end.
2. You can download the SQLITE3.DLL client library from the official website: http://www.sqlite.org/download.html
Re: Unidac sqlite
I have done another test on my demo.
I am using Windows 7 64 bit
Delphi 7
Unidac Professional. (registered)
The latest sqlite3.dll from their site x86-3100000
I have set Direct:= True;
ForceCreateDatabase:= True;
Have a SqliteUniprovider.
Here is the code which crashes Delphi.
Any thoughts.
Have also tested earlier versions with crashes as well.
Will test the console version now.
Have done that and it worked.
So what am I doing wrong with the normal version?
Tom
I am using Windows 7 64 bit
Delphi 7
Unidac Professional. (registered)
The latest sqlite3.dll from their site x86-3100000
I have set Direct:= True;
ForceCreateDatabase:= True;
Have a SqliteUniprovider.
Here is the code which crashes Delphi.
Code: Select all
UniConnection1.ProviderName := 'SQLITE';
UniConnection1.Database := 'c:\tom\fred.db';
UniConnection1.Connect;
UniConnection1.ExecSQL('CREATE TABLE T_TEST (ID INTEGER, NAME VARCHAR(50))',[]);
UniConnection1.ExecSQL('INSERT INTO T_TEST VALUES(1, ''Test Name'')',[]);
UniQuery1.Connection := UniConnection1;
UniQuery1.SQL.Text := 'SELECT * FROM T_TEST';
UniQuery1.Open;
ShowMessage(UniQuery1.FieldByName('ID').AsString + ' - ' + UniQuery1.FieldByName('NAME').AsString);
UniQuery1.Append;
UniQuery1.FieldByName('ID').AsInteger := 2;
UniQuery1.FieldByName('NAME').AsString := 'New Name';
UniQuery1.Post;
ShowMessage(UniQuery1.FieldByName('ID').AsString + ' - ' + UniQuery1.FieldByName('NAME').AsString);
UniQuery1.Close;
Have also tested earlier versions with crashes as well.
Will test the console version now.
Have done that and it worked.
So what am I doing wrong with the normal version?
Tom
Re: Unidac sqlite
Have tested the UniDac demo using a created sqlite file.
I used the file created with the console app.
It gave me an Access violation at address 007F.
Not a happy chap.
I used the file created with the console app.
It gave me an Access violation at address 007F.
Not a happy chap.

Re: Unidac sqlite
I have had success in my setting up with my local machine.
However, if I run in debug mode I get a blocking error.
If I run the exe then all is now fine.
Any thoughts on how I can reconfigure the debug mode to accept this error and work.
Thanks in advance.
Tom
sorry wrong area.
Will repost
However, if I run in debug mode I get a blocking error.
If I run the exe then all is now fine.
Any thoughts on how I can reconfigure the debug mode to accept this error and work.
Thanks in advance.
Tom
sorry wrong area.
Will repost
Re: Unidac sqlite
Thank you for the information. We have reproduced the issue and will investigate its origin. We will inform you about the results shortly
Re: Unidac sqlite
We continue investigation of the issue in UniDAC that leads to «Access violation at address 007F» . As a workaround, try to include FastMM (Fast Memory Manager) into your project. For this:
1. Download an archive with FastMM (http://sourceforge.net/projects/fastmm/);
2. Unpack the downloaded archive;
3. Add the path to the folder containing FastMM to the Library Path list: Tools\Environment Options...\Library\Library Path
4. Add the FastMM4 module at the first place to the uses section of your project .dpr file.
Let us know the results after including FastMM into your project.
1. Download an archive with FastMM (http://sourceforge.net/projects/fastmm/);
2. Unpack the downloaded archive;
3. Add the path to the folder containing FastMM to the Library Path list: Tools\Environment Options...\Library\Library Path
4. Add the FastMM4 module at the first place to the uses section of your project .dpr file.
Let us know the results after including FastMM into your project.