以下代码来自此处的文档:
Program ConnectDB
var AConnection : TSQLConnection;
Procedure CreateConnection;
begin
AConnection := TIBConnection.Create(nil);
AConnection.Hostname := 'localhost';
AConnection.DatabaseName := '/opt/firebird/examples/employee.fdb';
AConnection.UserName := 'sysdba';
AConnection.Password := 'masterkey';
end;
begin
CreateConnection;
AConnection.Open;
if Aconnection.Connected then
writeln('Succesful connect!')
else
writeln('This is not possible, because if the connection failed, ' +
'an exception should be raised, so this code would not ' +
'be executed');
AConnection.Close;
AConnection.Free;
end.
代码的主体对我来说很有意义,但我不知道TSQLConnection
从哪里来。我也不能使用CTRL + Space来自动完成它,这意味着我的程序没有引用它。顺便说一句,我正在尝试连接到 Postgres。
有人可以说明TSQLConnection
是什么吗?谢谢!