【发布时间】:2012-10-30 04:58:50
【问题描述】:
以下代码来自文档here:
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 是什么吗?谢谢!
【问题讨论】:
标签: freepascal lazarus dbconnection