You are not logged in.
Pages: 1
I use one of mORMot 2's great features which is "CreateMissingTables" to not writing db scripts for updating my MS SQL database, initially I used master branch for developing and then wanted to use 2.2 stable for production, but I found 2.2 stable did not work and got the exception per title when calling rest server's CreateMissingTables, I used the sample project "ex\ThirdPartyDemos\martin-doyle\05-HttpDaemonORM\src\Project05HttpDaemon.dproj" to verify it and it failed with 2.2 stable too, below is the modified code to use MS SQL:
procedure TSampleDaemon.Start;
var
Props: TSqlDBOleDBConnectionProperties;
begin
Props := TSqlDBOleDBMSSQL2018ConnectionProperties.Create('localhost','mormot','','');
SQLite3Log.Enter(self);
Model := CreateSampleModel;
VirtualTableExternalRegister(Model,[TOrmSample],Props);
// SampleServer := TSampleServer.Create(Model, ChangeFileExt(Executable.ProgramFileName,'.db'));
SampleServer := TSampleServer.Create(Model, ':memory:');
SampleServer.DB.Synchronous := smOff;
SampleServer.DB.LockingMode := lmExclusive;
SampleServer.Server.CreateMissingTables; //<-- throw exception: EOleSysError "Class not registered"
HttpServer := TRestHttpServer.Create(HttpPort,[SampleServer],'+',HTTP_DEFAULT_MODE,4 );
HttpServer.AccessControlAllowOrigin := '*';
SQLite3Log.Add.Log(sllInfo, 'HttpServer started at Port: ' + HttpPort);
end;
There was also a following exception:
Fatal exception ESqlite3Exception raised with message
Error SQLITE_ERROR (1) [Step] using 3.44.2 - Class not registered
Do I have to use master or there is a quick fix ?
Last edited by Bo (2024-05-28 12:42:39)
Offline
This happens to another machine too. The same application and same machine work okay if the application is compiled with master branch of mORMot 2. Does 2.2 stable support driver behind TSqlDBOleDBMSSQL2018ConnectionProperties?
Offline
That is great, looking forward to next one.
I have found out that it is a bug in 2.2 stable in TSqlDBOleDBMSSQL2018ConnectionProperties which you have fixed in master commit
Revision: 8e0ecde3ba26324e9d270493c58c16393355afb4
Author: Arnaud Bouchez <ab@synopse.info>
Date: 25/1/2024 01:45:48
Message:
fixed TSqlDBOleDBMSSQL2018ConnectionProperties
as reported by https://github.com/synopse/mORMot2/issues/238
----
Modified: src/db/mormot.db.sql.oledb.pas
Modified: src/mormot.commit.inc
Offline
Pages: 1