-
Content Count
201 -
Joined
-
Last visited
-
Days Won
3
Everything posted by Die Holländer
-
Convert Visual Studio 2012 code to Delphi
Die Holländer replied to Bahram Akhundov's topic in General Help
Please post your Delphi code and maybe you can get some help here. What SSH/TCP/UDP component did you use? Your basic task is to setup a small tcp/udp server that can listen to these 4 ports.. -
Not sure, but if you think the dproj is invalid. Make a copy, delete it from the project folder and open the *.dpr file and rebuild. It will create a new dproj. <edit> Ah, I see your last message and it errors on the *.dpr file.. You should look into this file..
-
Maybe it depends on which SQL driver the FD is using on the users machine. It uses a loop from the most recent driver (Delphi 11 : from version 17) to the least one and tries to find the most recent one. Look in the ODBC settings which drivers are installed on the machine. I've used many versions of MS SQL servers (also 2012) and had never problems with FD connecting them. Look at SQL Sever Native Client 10. for older SQL sever, like 2012. MSSQL Driver overview
-
unit Unit1; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls; type TForm1 = class(TForm) Button1: TButton; procedure Button1Click(Sender: TObject); private { Private declarations } public { Public declarations } end; var Form1: TForm1; procedure Encrypt(sr: PAnsiChar; key: PAnsiChar; var encryptedText: PAnsiChar); stdcall; external 'YourDLLName.dll'; procedure Decrypt(sr: PAnsiChar; key: PAnsiChar; var decryptedText: PAnsiChar); stdcall; external 'YourDLLName.dll'; implementation {$R *.dfm} procedure TForm1.Button1Click(Sender: TObject); var inputText, key, encryptedText, decryptedText: PAnsiChar; begin inputText := 'Hello World'; key := '12345678'; // Encrypt Encrypt(inputText, key, encryptedText); ShowMessage('Encrypted Text: ' + encryptedText); // Decrypt Decrypt(encryptedText, key, decryptedText); ShowMessage('Decrypted Text: ' + decryptedText); end; end.
-
>As I result, I have been running Delphi under my admin account. However, all of my Windows Credentials were created under my regular account. OK, I understand. You could not connect the database because your credentials where not avaible in your admin account. I think because Delphi has a user license not everyone using your computer with another login can use Delphi.
- 12 replies
-
A gem from the past (Goto)
Die Holländer replied to Mike Torrettinni's topic in Algorithms, Data Structures and Class Design
Ahh, a typical reaction that started in that time.. My Commodore 64 is much better. My Apple is much better than your Windows My Iphone is much better than you Android phone. My Javascript language is much better than ... -
Would be nice when you tell us what resolved the issue..
- 12 replies
-
What is your MSSQL server version? I Remember I had some problems when I used in the config under "Server" the servername instead of the ServerIP. Maybe you check that also. So, not xx.xx.edu but the real IP of the server, like 102.x.x.x Basically the FireDac config is creating a connectstring. Since you can login with the MS SQL Server Management Studio you can ask for the connectstring when logged in: SELECT 'data source=' + @@SERVERNAME + ';initial catalog=' + DB_NAME() + CASE type_desc WHEN 'WINDOWS_LOGIN' THEN ';trusted_connection=true' ELSE ';user id=' + SUSER_NAME() END FROM sys.server_principals WHERE name = suser_name() See also: ConnectStrings
- 12 replies
-
A gem from the past (Goto)
Die Holländer replied to Mike Torrettinni's topic in Algorithms, Data Structures and Class Design
In the early BASIC times, like for the ❤️ ZX-Spectrum ❤️ there were no functions or procedures but instead they introducted a way to jump to another part of the source and return to the next line after the jump. The statements: Gosub and Return. 10 LET A=0 20 PRINT "ENTER A NUMBER: " 30 INPUT N 40 GOSUB 100 50 PRINT "THE RESULT IS ";A 60 END 100 A = N * 2 110 RETURN -
WebUI framework: Technical preview. Part 1.
Die Holländer replied to Alexander Sviridenkov's topic in I made this
Any link to the webUI website? -
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)
- 12 replies
-
RAD Studio 12.1 Athens Patch 1 Available
Die Holländer replied to Uwe Raabe's topic in Delphi IDE and APIs
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. -
Looking for a couple of good "starter" Delphi books
Die Holländer replied to t2000kw's topic in General Help
Books by dr. Bob (Bob Swart) -
Best Practices for Database Development in Delphi with Firebird
Die Holländer replied to Noor's topic in VCL
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. -
{$Defines xxxx} not working at design time..
Die Holländer replied to Ian Branch's topic in Delphi IDE and APIs
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. -
Strange bug with string literals in RAD Studio 12
Die Holländer replied to luebbe's topic in RTL and Delphi Object Pascal
If you just did a first login then you have to wait some time before you can see reports... -
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..
-
Yes, try Chat-GPT to translate sourcecode. It is quite good in it..
-
Best Practices for Database Development in Delphi with Firebird
Die Holländer replied to Noor's topic in VCL
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; -
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
-
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.
-
I'm almost sure that nobody dares to click on this link...
-
What new features would you like to see in Delphi 13?
Die Holländer replied to PeterPanettone's topic in Delphi IDE and APIs
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! 🚴♀️🌞