Search the Community
Showing results for tags 'sqlite'.
Found 2 results
Hi, I'd like to test drive Interbase ToGo for perf compared to my current SQLite DB on mobile apps. In real world. Does anybody know of any free tool that can convert to and from Interbase <--> SQLite? I have TMS Data Modeler, but it doesn't transfer data. Any clue would be welcome. Thanks to all Steve
I have created a tethered app. The server needs to copy a Sqlite db and stream it to the client. I get the db with this code: procedure TfmxServer.actStreamTheDbExecute(Sender: TObject); var ms: TMemoryStream; begin ms := tmemorystream.Create; ms := dmplanner.GetDbAsStream; // get it from the datamodule ms.Position := 0; thrprofServer.SendStream(thrmanServer.RemoteProfiles.First, 'Stream_TheDB', ms); // send it to the client end; function TdmPlanner.GetDbAsStream: TMemoryStream; // datamodule var fs: TFilestream; ms: TMemoryStream; begin fs := tfilestream.Create(consqlite.Params.Values['Database'] , fmOpenRead); ms := tmemorystream.Create; try ms.loadfromstream(fs); // ms.size = 315392, file size = (315,392 bytes result := ms; // so I am getting the full db3 file. result.Position := 0; finally freeandnil(fs); freeandnil(ms); // does this kill the result? end; end; I catch the stream and to write the db with this code: procedure TfrmMobile_Client_Main.DoStreamTheDb( const Aresource: TremoteResource); var fs: TFilestream; ms: TMemoryStream; begin fs := tfilestream.Create (dmplannerclient.consqlite.Params.Values['Database'] , fmopenreadwrite or fmCreate); try ms := TMemoryStream.Create; ms := TMemoryStream(AResource.Value.AsStream); ms.Position := 0; // ms.size = 315392, so I got the whole file. ms.SaveToStream(fs); dmPlannerClient.FillLbx(lbxRecipeNames); // now fill a listbox, but when I open a query, I get // [FireDAC][Phys][SQLite] ERROR: unable to open database file. finally freeandnil(fs); freeandnil(ms); end; end; So my question is, How do I copy the db to the client and then use it on the client? Better yet, How do I an in-memory db instead of an on-disk db? I have tried setting the FDConnection filename to :memory: but that did not work. Delphi CE Rio 10.3.2 Thanks...Dan'l' +