When I issue the following query I get an error:
Code: Select all
aLoginName := 'NewUserName';
aPassword := 'NewUserPassword1!';
Query.SQL.Text := 'CREATE LOGIN :LoginName WITH PASSWORD = :Password';
Query.ParamByName('LoginName').AsString := aLoginName;
Query.ParamByName('Password').AsString := aPassword;
Query.Execute;
HOWEVER, this code DOES work:
Code: Select all
Query.SQL.Text := 'CREATE LOGIN NewUserName WITH PASSWORD = ''NewUserPassword1!''';
Query.Execute;
The code is in exactly the same place and is connected to the master database.
As a side note, calls to Query.FinalSQL don't seem to give the full query with the parameters expanded.
Thanks!