firedac

Firemonkey Mobile Application and remote MySQL

大憨熊 提交于 2019-12-24 04:52:08
问题 I am using Delphi XE5 and I have created basic Firemonkey Mobile Application - Delphi I would like to connect to a remote MySQL database. Which if any database conduit do I use? (FireDAC, DBExpress, etc)? 回答1: You can use standard TSQLQueries, but as your mobile app needs to connect to a remote database, you will need to go via a DataSnap service (most probably hosted on an IIS server). The mobile device then connects to the DataSnap server which then connects to the database. The DataSnap

Setting a relative path to sqlite database with Delphi and Firedac

六眼飞鱼酱① 提交于 2019-12-24 01:17:57
问题 In replacement of my previous question which was confusing and poorly formulated, here is the "real" question. I would like to known how to set, with Firedac, at runtime, a relative path to a sqlite database located in a subfolder of my application folder. As Jerry Dodge stated : Any application should never rely on writable data in the same directory anyway. Also, even if you did, you should make sure all your paths are relative to the application at least. At the moment, the application I

ON CONFLICT(id) DO UPDATE SET does not work for FireDAC in DELPHI 10.3.1

。_饼干妹妹 提交于 2019-12-24 01:04:23
问题 After attaching the second database I tried to insert and update data in the table of the first database using ON CONFLICT(id) DO UPDATE. Field id is the primary key for the first table. FDQuery1.EXECSQL('ATTACH ''D:\Update2019.DB'' AS DBUpdate'); FDQuery1.SQL.Text:= 'INSERT INTO acts (id,title) SELECT id,title FROM DBUpdate.acts'+ ' WHERE (DBUpdate.acts.id >100)'+ ' ON CONFLICT(id) DO UPDATE SET'+ ' title=excluded.title;' FDQuery1.ExecSQL; I get error message: "ERROR near "ON":syntax error"

How can I create a new SQLite file and table at runtime using FieldDefs?

纵然是瞬间 提交于 2019-12-23 15:31:17
问题 I'm using Delphi Seattle to create a brand new table in a brand new SQLite file and using only FieldDefs and non-visual code. I can create a table using the ExecSQL ('CREATE TABLE....' ) syntax but not as shown below (I get 'No such table 'MyTable' which is raised when I execute the CreateDataSet call). I'd like some solution that allows me to work with FieldDefs. This code is modelled on the example here. I notice though, that there is note regarding CreateDataSet that it only applies to

Creating a database in Firebird using FireDac (Delphi)

假装没事ソ 提交于 2019-12-23 14:55:24
问题 I recently changed from AnyDac to FireDac (8.0.5.3365). We're running Delphi 2006. When I was using the AnyDac version of this component I could create a new database by doing the following.. Setup my connection fConnection.LoginPrompt := false; fConnection.ResourceOptions.SilentMode := true; fConnection.Params.Clear; fConnection.Params.Add(Format('DriverID=%s', ['IB'])); fConnection.Params.Add(Format('Database=%s', [fConnectionInfo.xDatabase])); fConnection.Params.Add(Format('CharacterSet=%s

Firedac Query Field list not updated after Schema change

∥☆過路亽.° 提交于 2019-12-22 21:45:08
问题 I am creating a temp table in SQL and then adding a new field to it. It seems Firedac is caching the field list for this temp table. The following code gives me "FDQuery5: Field 'Available' not found." FDQuery5.Connection := FDConnection1; FDConnection1.ExecSQL('Select StockNo into #Temp from Stock'); FDQuery5.SQL.Text := 'Select * From #Temp'; FDQuery5.open; FDConnection1.ExecSQL('Alter Table #Temp add Available Char(1)'); FDQuery5.Close; FDQuery5.open; ShowMessage(FDQuery5.FieldByName(

Insufficient memory when opening TClientDataSet with a REPLACE in the underlying query

牧云@^-^@ 提交于 2019-12-22 10:44:16
问题 My Delphi code opens a TFDQuery (FireDAC), then opens the TClientDataSet connected to it via a TDataSetProvider : ClientDataSetData.Close; with QueryData do begin Close; SQL.Clear; SQL.Add(ASelectSQL); Open; end; ClientDataSetData.Open; ASelectSQL contains this SQL: SELECT TT_NIV_ID, TT_NIV, REPLACE(TT_NIV_NAME, '|', '!') as TT_NIV_NAME2 FROM TT_SYS_PRJ_NIV The ClientDataSetData.Open gives an insufficient memory error on a dataset with 42200 records. If I inspect the result data (in the

Parameter.AsString failing under Oracle/MSSQL - Parameter.Value 2-byte chars under Oracle

梦想与她 提交于 2019-12-19 16:33:10
问题 After changing to FireDAC I have trouble getting this code to work on MSSQL/Oracle: with DataFormsettings do begin Close; if Params.Count=0 then FetchParams; Params.ParamByName('TT_EMP_ID').Asinteger := AEmpID; Params.ParamByName('TT_FORM').AString := UpperCase(AKey); Open; if (RecordCount>0) then S := FieldByName('TT_VIEWDATA').Asstring; end; AKey and S are both strings. The Open statement gives an error [FireDAC][Phys][MSSQL]-338 Param type changed from [ftString] to [ftWidestring] [FireDAC

Could not open Paradox.net

柔情痞子 提交于 2019-12-13 22:39:17
问题 Trying Delphi 10.2 Tokyo with Paradox FireDAC ODBC on Windows 10 throws error Could not open Paradox.net. This link describes the problem: https://msdn.microsoft.com/en-us/library/bb221383(v=office.12).aspx An Embarcadero FireDAC ODBC connection to Paradox table, by default will set ParadoxNetPath to System32 folder: ODBCAdvanced=CollatingSequence=ASCII;DefaultDir=C:\DEV\TPDEMOS\DATA;DriverId=538;MaxBufferSize=2048;MaxScanRows=8;PageTimeout=600;ParadoxNetPath=C:\Windows\system32

Out of memory when inserting records in SQLite, FireDac, Delphi

时光怂恿深爱的人放手 提交于 2019-12-13 18:17:38
问题 I have a Delphi app that inserts some 200,000 records (about 1GB) into an SQLite database via the FireDac component TFDTable. As it inserts, I can see the application memory increasing until I get an "Out of Memory Error". I'm guessing it has something to due with cache and paging but I cant find anything that fixes it short of closing and reopening the database every 1000 records or so. Thoughts? Edited... Sorry for the thinly worded question... The code was simple so I didn't include it but