通过TCP/IP连接DB,无需安装Oracle客户端.
procedure TForm1.Button1Click(Sender: TObject); begin self.OraSession1.Connected :=False; Self.OraSession1.Options.Direct:=true; //一定要设置为true self.OraSession1.ConnectString :='username/password@hostorIP:端口:serviceName';
//比如:'root/abcd1234@10.132.10.3:1521:testdb' try self.OraSession1.Connected :=true; except on E:Exception do raise Exception.Create(E.Message); end; ShowMessage('連接成功'); end;