0

次のコードは、こちらのドキュメントからのものです。

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? ありがとう!

4

1 に答える 1

2

TSQLConnectionオブジェクトはユニットで定義され、( interbase、firebird)、(mysql)、(postgres)sqldbなどの特定の接続コンポーネントの基本クラスです。TIBConnectionTConnectionNameTPQConnection

于 2012-10-30T05:42:05.820 に答える