Jump to content

Search the Community

Showing results for tags 'firedac'.



More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Delphi Questions and Answers
    • Algorithms, Data Structures and Class Design
    • VCL
    • FMX
    • RTL and Delphi Object Pascal
    • Databases
    • Network, Cloud and Web
    • Windows API
    • Cross-platform
    • Delphi IDE and APIs
    • General Help
    • Delphi Third-Party
  • C++Builder Questions and Answers
    • General Help
  • General Discussions
    • Embarcadero Lounge
    • Tips / Blogs / Tutorials / Videos
    • Job Opportunities / Coder for Hire
    • I made this
  • Software Development
    • Project Planning and -Management
    • Software Testing and Quality Assurance
  • Community
    • Community Management

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Delphi-Version

Found 67 results

  1. bazzer747

    Master-Detail Example

    Does anybody know where I can find a (simple) example of setting up a Master-Detail on two tables (MSSQL in my case)? All I can find via the internet are either overly complicated examples or in non-English languages. The Help in Delphi/Firedac is the former and very difficult to follow.
  2. Jacek Laskowski

    FDQuery, threads and CmdExecMode

    When I create FDQuery in threads, should I set CmdExecMode to amNonBlocking or leave amBlocking? http://docwiki.embarcadero.com/Libraries/Tokyo/en/FireDAC.Stan.Option.TFDResourceOptions.CmdExecMode
  3. I just noticed in Rio 10.3.2 that the TFDSQLScript SQL editor has the Code Editor button in the String List Editor disabled. I popped up the help and there does not seem to be a reason for this. The SQL property is of type TSrings in the Inpsector and the actual implementation uses TFDStringList just the same as the connection Params ancestor class in which you can use the Code Editor. Is this a case of a missing property editor registration? It would be very nice to be able to use the Code Editor to modify scripts instead of cop[y/pasting from an external editor.
  4. Alberto Fornés

    [Firedac] Connection Pooling

    Hi, I'm trying to establish a connection to Firebird, using the connection pool. In my project I have several datamodules, which I create and destroy continuously. The first datamodule that is created reads the connection configuration, connects (this does it well) and then saves the parameters of this connection in the connection definition (I use the folowing code): Connect is a TFDConnection component var oDef: IFDStanConnectionDef: = FDManager.ConnectionDefs.AddConnectionDef; oDef.Name:= defConn; oDef.Params.Pooled: = true; oDef.Params.DriverID: = 'FB'; oDef.Params.Database: = Connect.Params.Values ['Database']; oDef.Params.Password: = Connect.Params.Values ['Password']; oDef.Params.UserName: = Connect.Params.Values ['UserName']; oDef.Params.Values ['ExtendedMetadata']: = 'true'; oDef.Params.Values ['CharacterSet']: = 'UTF8'; Then, when I open other datamodules, the first thing I do is assign the definition of the connection, and then I connect, but this gives an error it seems that it does not assign the user and password correctly: Connect is the TFDConnection component of the new created datamodule Connect.ConnectionDefName: = defConn; Connect.Connected: = true; (this gives connection error) Any suggestions of things to review and / or change?, thanks Note: The datamodule where I set the connection parameters and establish the connection definition, is also destroyed after read and apply this settings.
  5. Hi, We are trying to add the functionality to allow the user to change the SQL server password if it is expired. The following code snippet using TFDConnection shows what we are trying to do: FDConnection1.Params.Values['Server'] := 'SQLExpress'; FDConnection1.Params.Values['Database'] := 'TestDatabase'; FDConnection1.Params.Values['User_Name'] := 'testuser'; FDConnection1.Params.Values['Password'] := 'oldpass'; FDConnection1.Params.NewPassword := 'newpass'; FDConnection1.Open; But when we get an error while trying to change it: [FireDAC][Phys][ODBC][Microsoft][ODBC SQL Server Driver] Login failed for user 'testuser'. (Error Code is 18456) Tools we use: RAD Studio 10.2 FireDAC = 16.0.0 (Build 88974) Platform = Windows 32 bit SQL Server 2016 express edition ODBC Driver 17 for SQL server. What we observed is that if we use then it works with a patch in FireDAC units. (While debugging we found that it uses a method TFDPhysMSSQLConnection.CheckPasswordChange which uses a connection to check the SQL versions but by that time the connection was not able to make because of the password expiration. So we commented the code inside "CheckPasswordChange" and then it started to work.) But we are told to use ODBC Driver because Microsoft is not going to support Native Client in the future. Is it possible to change an expired password using FireDAC in combination with ODBC driver.? If that is possible then any advice to fix the problem mentioned above? Kind Regards, Soji Mathew.
  6. Rafael Dipold

    TFDEventAlerter bug?

    I've created an MCVE that simulates a problem that eventually happens in our software, where software freezes when it tries to register an event when a previously registered event triggers within the same cycle. In an internal test, we found that this also occurs using the TIB_Events component. Would this be a Firebird or FireDAC bug? unit Unit1; interface uses Winapi.Windows, Winapi.Messages, System.Classes, System.SysUtils, Vcl.Controls, Vcl.Forms, Vcl.StdCtrls, FireDAC.Comp.Client, FireDAC.Comp.UI, FireDAC.Phys, FireDAC.Phys.FB, FireDAC.Phys.FBDef, FireDAC.Phys.IBBase, FireDAC.Stan.Async, FireDAC.Stan.Def, FireDAC.Stan.Intf, FireDAC.UI.Intf, FireDAC.VCLUI.Wait; type TForm1 = class(TForm) Button1: TButton; procedure FormCreate(Sender: TObject); procedure FormDestroy(Sender: TObject); procedure Button1Click(Sender: TObject); private FConn : TFDConnection; FEvents: TFDEventAlerter; procedure EventAlert(ASender: TFDCustomEventAlerter; const AEventName: String; const AArgument: Variant); public { Public declarations } end; var Form1: TForm1; implementation {$R *.dfm} procedure TForm1.Button1Click(Sender: TObject); begin FConn.ExecSQL('EXECUTE BLOCK AS BEGIN POST_EVENT ''EVENT_1''; END'); FEvents.Names.Add('EVENT_2'); end; procedure TForm1.EventAlert(ASender: TFDCustomEventAlerter; const AEventName: String; const AArgument: Variant); begin Caption := AEventName + ' ' + DateTimeToStr(Now); end; procedure TForm1.FormCreate(Sender: TObject); begin FConn := TFDConnection.Create(nil); FConn.LoginPrompt := False; FConn.DriverName := 'FB'; FConn.Params.Values['DriverID'] := 'FB'; FConn.Params.Values['CharacterSet'] := 'ISO8859_1'; FConn.Params.Values['Server'] := '127.0.0.1'; FConn.Params.Values['Database'] := 'c:\temp\whatever.fdb'; FConn.Params.Values['User_Name'] := 'SYSDBA'; FConn.Params.Values['Password'] := 'masterkey'; FEvents := TFDEventAlerter.Create(nil); FEvents.Connection := FConn; FEvents.Names.Add('EVENT_1'); FEvents.OnAlert := EventAlert; FEvents.Register; end; procedure TForm1.FormDestroy(Sender: TObject); begin FEvents.Free; FConn.Free; end; end.
  7. Stuart Clennett

    FireDAC Connections

    Hi, I'm looking at the TMARSFDDataModuleResource and I see that it has protected members `FD` (TMarsFireDAC) and `URL` (TMARSURL). In my descendant class both of these are `nil` references. Is there a way to use this? Reason is I'm trying to switch DB connections based on the server's own host URL. E.g. if it's accessed via localhost or 192.168.x.x then use the LOCAL_DB connection def, otherwise use PROD_DB Edit: Which also begs the question, where is the best place to call `FD.ConnectionDefName := MyConnectionDefName;` ? Thanks Stuart
  8. Mark Williams

    TFDBatchMove delete records

    I am using a TFDQuery component to load and edit records from a table using CachedUpdates. Records can be deleted from the table as well as edited and appended. The BatchMove component in dmDelete mode deletes all records in the query and not just those that have been flagged for deletion. Is there any way of using the BatchMove component so that it only deletes records where the updateStatus is usDeleted?
  9. I am trying to work with integer arrays in a Postgres integer[] field. I have read somewhere that with Postgres you need to use NestedDataSets to read the data rather than TArrayField and that seems to be correct. I can successfully write back to the dataset using TArrayField in an Insert Query. I can read from the integer[] field using TDataSet and nested fields. However, I cannot work out how to write to the TDataSetField. I have tried the following: Edit; TT:=TDataSetField(Fields[2]); for i:=0 to high(arr) do begin TT.NestedDataSet.Append; TT.NestedDataSet.Fields.Fields[0].Value:=arr[i]; end; The error I get on trying to post data edited as above is I tried to use "AsInteger" instead of value, but got the same error.
  10. Mark Williams

    FireDAC paramamania

    I am having difficulties with a parameterized query designed to be used repeatedly. It works first time but never a second. The query is fairly complicated so I prepare it on app initialization for repeated use, but it works just once and returns an empty dataset on every other occasion (even with the same parameter). If I reset the query text (FDQuery.SQL.Text := FDQuery.SQL.Text) it works as expected. That rather defeats the purpose of preparing the query in advance. Is it the case that parameters cannot be used in repeated queries?
  11. Mark Williams

    FireDAC clearDetails or EmptyDataSet

    I have been using ClearDetails to remove all records from TFDQuery components. However, I have experienced a problem today where a call to ClearDetails for a reusable query that is designed to return a single record is not removing that record. The description for this function states: Pretty much what I was expecting it to do, but (in this one case at least) it is not. I have switched to EmptyDataSet which does the job, but should I be updating all places where I use ClearDetails to update to EmptyDataSet?
  12. Flavio Basile

    Firedac Json Reflection from XE7 to Rio

    Hi All; we have a big commercial project; It is coded with C++ Builder XE7. We have many Web Broker that after a call returns a dataset by Firedac Json Reflection. We would like to migrate our code from XE7 to Rio but we would like to know if there are difference between Json Reflection format of XE7 and Rio. There are also some important difference in Firedac between XE7 and Rio that we need to evaluate? Could we migrate our code without any important problems? Thanks, Flavio
  13. Martyn Spencer

    Firedac and SQL Server DB with "." in name

    I am using Delphi 10.2 and I have been given a database to connect to and I have no control over its name. It is in the format xxxx.yyyy and when I create the connection definition, all is good and I can connect. I am specifying the database as xxxx.yyyy and setting the other various parameters appropriately (the same as I do for other databases). I can use the SQL tool in the connection editor to query the tables just fine. I create a simple TFDQuery consisting of a basic "select * from table" and when I attempt to run it, I am told that database xxxx is not in the list of valid servers and it should be added to sys.servers using sp_addlinkedserver. Clearly, what Firedac is passing to SQL server leads SQL server to interpret the xxxx as a server name. I have tried "select * from tablename", "select * from dbo.tablename", "select * from [xxxx.yyyy].tablename", "select * from [xxxx.yyyy].dbo.tablename" and other variations and still it refuses to work. I am setting no specific values for the components - I create the definition in the data explorer, test that it connects, test that I can use the "SQL script" tab to run various SQL statements. I then drag one of the tables onto the form designer (a quick test) and try to run the query and it fails with the message: "Could not find server 'xxxx' in sys.servers. Verify that the correct server name was specified. If necessary, execute the stored procedure sp_addlinked server to add the server to sys.servers". I have tried removing the database name from the connection definition, in the hope that the default database has been set - this does not work. Any suggestions, please? I am unable to request that the database name be changed.
  14. I am porting a Win32 with FB app to Android. When the datamodule uses FireDAC.Phys.FB the Linker fails with [DCC Error] E2597 c:\\program files (x86)\\embarcadero\\studio\\20.0\\lib\\Android\\Release\libibtogo.a(fun.o): In function `FUN_evaluate': /builds/InterBase_ANDROID_TOGO_IB2017/super/jrd/fun.c:277: undefined reference to `abs' c:\\program files (x86)\\embarcadero\\studio\\20.0\\lib\\Android\\Release\libibtogo.a(fun.o): In function `FUN_resolve': /builds/InterBase_ANDROID_TOGO_IB2017/super/jrd/fun.c:947: undefined reference to `abs' Is this because Android does not support FB? Can I use Interbase? Is there a solution for this? Thanks...Dan'l
  15. Hi, I got FireDAC functionality working with the EMPLOYEE table. I wanted to load/save data using a json file for simple app config data, but as soon as I placed a TFDMemTable on the data module, I get an Access Violation when I request anything from that resource. (E.g. a GET on the original Employee table). The call stack says the a/v occurs in MARS.Data.FireDAC.TMARSFireDAC.InjectMacroValues(nil, True) which is in turn called from TMARSFDDataModuleResource.Retrieve. I have not changed any properties on the FDMemTable nor added any code. When I delete the component and recompile the server, the a/v goes away. This can be easily replicated using the FireDACBasic demo, by adding a TFDMemTable to the Server.MainData datamodule. Thanks for your help Stuart
  16. Hi, anybody had troubles performing a backup of a FB3 embedded database through the TIBBackup component? Firebird 3 uses fbclient.dll as client library also for embedded connections so it seems there's something wrong in the TIBBackup component when determining the client library to use (FireDAC.Phys.IBWrapper unit, TIBLib.GetLibraryInfo function. Given sLib var is always 'fbclient.dll' it misses it is a Firebird embedded connection). We tried to force fbclient.dll as vendor lib (giving a proper value to the DriverLink property of the TIBBackup instance, we also tried to set Embedded property of the driver link manually) but no way, it is always looking for fbembed.dll instead of the specified one (fbclient.dll). A quick and dirty workaround is to copy the DLL (fbclient) with the old name (fbembed) but I would like to avoid this, if possible. Any help would be appreciated. Maybe @Dmitry Arefiev may enlight us 😉 Thanks in advance
  17. Juan C.Cilleruelo

    Which type will hold better a TBCDField value?

    #Delphi, #FMX, #FireDAC. I have a DB Field defined as DECIMAL(15, 3); This produce permanent fields on my program of the type TBCDField. All of this is correct. Sometimes I need to Assign the value of one of this fields to a local or class variable. Which type do you recommend for this variable to assure I do not go to lost precision and the value is going to be near to an unaltered form?
×