oraSession直连

通过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;

  

posted on 2020-10-14 11:55  天上星  阅读(270)  评论(0编辑  收藏  举报

导航