You are not logged in.
Pages: 1
It looked to be convenient to use "TSynConnectionDefinition" but I failed to make it work.
Login failed due to missing password.
My code look like this:
fStore: TSynConnectionDefinition;
fStore := TSynConnectionDefinition.CreateFromJSON(StringToUtf8('{ "Kind": "TOleDBMSSQL2012ConnectionProperties", '
+ '"ServerName": "MyServer\\SQLEXPRESS", "DatabaseName": "MyDB", "User": "username", "Password": "myPassword"}'));
fDBServer := TSQLRestExternalDBCreate(fModel, fStore, false, []);
TSQLRestExternalDBCreate looks for fStore.PasWordPlain which does not exist in fStore.
What's wrong with my assumption?
Delphi-11, WIN10
Offline
I don't understand exactly what you meant but I did like this:
fStore: TSynConnectionDefinition;
pw: RawUTF8
pw := TSynConnectionDefinition.ComputePassword('myPassword');
fStore := TSynConnectionDefinition.CreateFromJSON(StringToUtf8('{ "Kind": "TOleDBMSSQL2012ConnectionProperties", '
+ '"ServerName": "MyServer\\SQLEXPRESS", "DatabaseName": "MyDB", "User": "username", "Password": "'+pw+'"}'));
fDBServer := TSQLRestExternalDBCreate(fModel, fStore, USE_AUTHORIZATION, []);
And that worked, but that wasn't exactly what you said?
Last edited by larand54 (2022-01-01 19:22:49)
Delphi-11, WIN10
Offline
Pages: 1