Jump to content

Die Holländer

Members
  • Content Count

    277
  • Joined

  • Last visited

  • Days Won

    5

Everything posted by Die Holländer

  1. Die Holländer

    ...cannot contact a domain controller..

    This is the config that works here.. Note, the DatabaseName is added two times. (Also MetaDefCatalog) "dbo" as the MetaDefSchema. Play with the OSAuthent and MARS properties. (switch Yes/No)
  2. Die Holländer

    RAD Studio 12.1 Athens Patch 1 Available

    I'm still on 11.3 and soon will switch to 12. I just see in the video that this new JSON feature is now in Delphi 12... Is it working as I think it's working ?? After reading the JSON it's possible to directly access the keynames (email, address.street, ..) to get the values as weaktype languages can do, like Javascript.
  3. Die Holländer

    Looking for a couple of good "starter" Delphi books

    Books by dr. Bob (Bob Swart)
  4. Whatever you program in Delphi, compared with most other languages, it will stay RAD and you can focus on you actual problem instead for example fighting how to put things on the screen. It takes the Online department, with Node, Javascript and pumping JSON files through the internet, with three developers (backend, frontend and HTML/CSS designer) about one week for one screen. They calling Delphi old fashioned while I look to their source and problems as if they still live in the 1980's.
  5. Die Holländer

    {$Defines xxxx} not working at design time..

    I have noted something like this by the {$IFDEF DEBUG} switch in D11.3. When switching the "Build Configurations" from Debug to Release nothing happens. When staying in the Unit and do Compile or Build nothing happens. but When I switch in the editor from that source/unit tab to another source and back it works and the editor will gray-out the proper sourcecode.
  6. If you just did a first login then you have to wait some time before you can see reports...
  7. Die Holländer

    C Libraries to Delphi

    Yes, but the use is not to get a clean 100% translation. It will give you a lot of insight of the differences between Delphi/Pascal and C keywords/declarations etc.. >It will probably be a bit stubborn since it's so much code, so you'll have to step through it Yes, like the programmer that has to translate the code..
  8. Die Holländer

    C Libraries to Delphi

    Yes, try Chat-GPT to translate sourcecode. It is quite good in it..
  9. For a (very) long time I use dataobjects to query the database and I'm still very happy about it. I would otherwise get mad hiding all the actual queries away from sourcecode by adding them in the TFDQuery properties. If you do it in the classic way using a datamodule then in the long run with large applications you will end up with a lot of TFDQueries on the module and your application will start very slow. For example to use the DataObject looks like this: MyDataObject:=TMyDataObject.Create('DatabaseName'); try MyDataObject.Code:='1234'; If not MyDataObject.qryMyName.eof then Begin txtEdit.Text:=MyDataObject.Name; End; Finally MyDataObject.Free; End; You can decide to make such dataobject for every table in your database. Use the main table if you have Joins in the Query. If you have a new query you add a new Setter in the object. In this way you can reuse the queries in your entire code. (or in a comple other project/application) For example if your TFDQuery is in the Public section you can still do things in the GUI like: MyDBGrid.Datasource.DataSet:=MyDataObject.qryMyName; Note: If you need more parameters in your query you can create the property like: property CodePersonsID[aCode: Integer] : Integer write SetCodePersonsID; procedure SetCodePersonsID(aCode: Integer; aPersonsID: Integer); MyDataObject.CodePersonsID[45]:=99888; A simple DataObject can look like this: TMyDataObject = Class(TObject) Private fDataBaseName: String; protected procedure SetCode(aCode : String); function GetCode : String; function GetName : String; Public qryMyName : TFDQuery; procedure All; property Code : String read GetCode write SetCode; property Name : String read GetName; Constructor Create(aDataBaseName: String); Destructor Destroy; Override; End; implementation uses SysUtils; Constructor TMyDataObject.Create(aDataBaseName: String); Begin Inherited Create; fDataBaseName:=aDataBaseName; //Create here your own TFDQuery.Create procedure.. database_initQuery(fDataBaseName, 'qryMyName', qryMyName); End; Destructor TMyDataObject.Destroy; Begin If qryMyName<>NIL then qryMyName.Free; Inherited Destroy; End; procedure TMyDataObject.All; Var SQLText : String; Begin SQLText:='select * from "MyTable" '; qryMyName.Active:=False; qryMyName.SQL.Clear; qryMyName.SQL.Add(SQLText); qryMyName.Active:=True; qryMyName.First; End; procedure TMyDataObject.SetCode(aCode : String); Var SQLText : String; Begin SQLText:='select * from "MyTable" where Code= :CODE'; qryMyName.Active:=False; qryMyName.SQL.Clear; qryMyName.SQL.Add(SQLText); qryMyName.ParamByName('CODE').AsString:=aCode; qryMyName.Active:=True; qryMyName.First; End; Function TMyDataObject.GetCode : String; Begin With qryMyName do Begin if FindField('code')<>NIL then Result:=FieldByName('code').AsString else Result:=''; End; End; Function TMyDataObject.GetName : String; Begin With qryMyName do Begin if FindField('name')<>NIL then Result:=FieldByName('name').AsString else Result:=''; End; End;
  10. Die Holländer

    D5 data file misread in XE program

    I just testing this ChatGPT IDE implementation and I thought let's give it a shot. //To ensure that XE interprets the strings correctly, //you can try explicitly setting the encoding when reading //the strings from the data file. //Here's an example of how you could modify your code to //read the strings as Windows 1252 encoded: delphi procedure TForm1.FormActivate(Sender: TObject); var morphlex: file of string[32]; str: AnsiString; nooflexrecs: Integer; begin AssignFile(morphlex, 'MorphIr.dat'); Reset(morphlex); nooflexrecs := FileSize(morphlex); ShowMessage('Data file contains ' + IntToStr(nooflexrecs) + ' records'); // Read strings using Windows 1252 encoding while not Eof(morphlex) do begin BlockRead(morphlex, str, SizeOf(str)); // Convert string to Unicode if needed ShowMessage(TEncoding.GetEncoding(1252).GetString(PAnsiChar(str))); end; CloseFile(morphlex); end; //In this updated code snippet, we use `AnsiString` to //read the string data from the file as it is not Unicode. //We then convert the `AnsiString` to Unicode using //the `TEncoding.GetEncoding(1252).GetString` method to //interpret the Windows 1252 encoded strings correctly. //Please note that this code assumes that the string data //in the file is in Windows 1252 encoding. //If the actual encoding is different, you may need to //adjust the encoding parameter accordingly
  11. Die Holländer

    ChatGPT plug-in for RAD Studio.

    The plug-in is working great and the warning is indeed not a problem. 👍 I've downloaded the ZIP from GitHub and build/installed the *.dpk file and that went very smooth. The message I got directly after installing the plug-in. From the IDE main menu I opened the Chat-GPT settings and pasted the API-key and did Save/Close without any other input in the setting dialog.
  12. Die Holländer

    ChatGPT plug-in for RAD Studio.

    What makes it that it thinks that I use an offline server?
  13. Die Holländer

    kuLibrary

    I'm almost sure that nobody dares to click on this link...
  14. Die Holländer

    What new features would you like to see in Delphi 13?

    BING: Welche Fahrradverleihe gibt es in Braunsbedra? Verkenne In Braunsbedra, gibt es einige Fahrradverleihe, die Ihnen hochwertige Räder für die Erkundung der wunderschönen Seenlandschaft anbieten. Hier sind einige Optionen: Radmanufaktur: Die Radmanufaktur in Merseburg (Hölle 1, 06217 Merseburg) bietet E-Bikes und andere Fahrräder. Die Öffnungszeiten sind dienstags bis freitags von 12:00 bis 18:00 Uhr und samstags von 09:00 bis 13:00 Uhr1. Bike-dom: Bike-dom in Naumburg (Marienstr. 1, 06618 Naumburg) verleiht ebenfalls Fahrräder. Sie sind montags bis freitags von 10:00 bis 18:00 Uhr und samstags von 09:00 bis 12:00 Uhr geöffnet2. Walk & Bike UG: Die Walk & Bike UG in Naumburg (Georgenberg 5, 06618 Naumburg) bietet Fahrräder für Touren um den Geiseltalsee. Sie sind montags bis freitags von 09:00 bis 17:00 Uhr und samstags von 09:00 bis 12:00 Uhr geöffnet3. Alle diese Verleihe ermöglichen es Ihnen, die malerische Umgebung zu erkunden und den Geiseltalsee auf dem ca. 25 km langen Rundweg zu genießen. Wählen Sie zwischen Kinderrädern, sportlichen MTBs, Trekking- und gemütlichen City-Bikes mit oder ohne E-Antrieb. Viel Spaß beim Radfahren! 🚴‍♀️🌞
  15. Die Holländer

    Encrypt ini file

    You can consider not to use the INI but the Windows Credential Manager for storing information. Very easy to use (read/write) from Delphi.
  16. Die Holländer

    Does FireDAC allow more than one connection?

    Which database?
  17. Die Holländer

    Extend Standard VCL

    >>without creating a new component? >>and I think about a new VCL. Sounds a bit strange.. Don't modify the original VCL component (if you have the Delphi sourcecode..) Modifying_Existing_Controls
  18. This native client 11 driver was for us the only one that was usable for 2012, 2014 and maybe for your 2017 too. We went to the latest MSSQL sever recently and for that server we needed one of the latest driver and indeed the Native Client 11 driver will not work anymore. We use SQL ODBC 18 at the moment. I had a machine that was not working good either and the trick was to install the MSSQL Server Management Studio on that machine. The Studio also installs a driver and other dependencies.
  19. Like Peter said. Check your idx AFTER the call statement. Tested in Delphi 11.3
  20. Die Holländer

    Crowdstrike antivirus killing Delphi

    Sometimes this happens. Whitelist the App in the virus software.
  21. Die Holländer

    Help to find database error

    delphibasics.co.uk
  22. I took over a Delphi Mormot webserver with source and both Get (root) and Post (rootp) are implemented. GET implementation FModel := TSQLModel.Create([], StringToUTF8(fRoot)); FServer := TSQLRestServerFullMemory.Create(FModel, 'test.json', False, False {true}); FServer.ServicesRouting := TSQLRestRoutingREST2; POST implementation FModel_Post := TSQLModel.Create([], StringToUTF8(fRootPost)); FServer_Post := TSQLRestServerFullMemory.Create(FModel_Post, 'test.json', False, False {true}); FServer_Post.ServicesRouting := TSQLRestRoutingJSON_RPC2; //I can change this (to Rest?) if needed because the POST method is not used yet.. There is a test function Add and is called by the client as: localhost:8181/root/<ApplicationName>/Add?n1=1&n2=5 (with http://) Now I want to use the POST method of the server and test it with a small HTTP client program to call the add function. I have tried a lot of ways but no success.. (Bad Request) For example: PostData := TStringList.Create; try PostData.Add('{"n1":1,"n2":5}'); Param:='http://localhost:8181/rootp/<ApplicationName>.Add'; IdHTTP1.HTTPOptions := IdHTTP1.HTTPOptions + [hoNoProtocolErrorException, hoWantProtocolErrorContent]; IdHTTP1.Request.ContentType := 'application/json'; IdHTTP1.Request.Accept := 'application/json'; IdHTTP1.Request.CacheControl := 'no-cache'; ReceiveData:=IdHTTP1.POST(Param,PostData); Finally PostData.Free; End; What is the proper way to use the POST request ? Thanks.
  23. Die Holländer

    Switch MorMot webserver from Get to Post

    I've tried that but what I understand is that declaration with the slash is when you create the server with the TSQLRestRoutingREST2 servicerouting instead of TSQLRestRoutingJSON_RPC2. When trying to use parameters the server responds with: { "errorCode":406, "errorText":"sicShared execution failed (probably due to bad input parameters: e.g. did you initialize your input record(s)?) for ScenarioAnalyseTester.Add" } The POST method is working when the server is started with TSQLRestRoutingREST2 and the whole URL string is like the Get method: localhost:8181/root/<ApplicationName>/Add?n1=1&n2=5 and leave the parameters empty but I guess there must be a way to get the result by using the "rootp" server with TSQLRestRoutingJSON_RPC2 and the parameters field of the POST method..
  24. Die Holländer

    ODBC, mssql and dbexpress

    If you add the connection by the data explorer you get a wizard that can help you to get the proper parameters for your .ini file Are you sure that the database parameter in your ini must be ";DAtabase = qclocal;" (not sure if it is case sensitive.. DAtabase?)
×