次のコードは、こちらのドキュメントからのものです。
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
? ありがとう!