Home > Back-end >  Delphi with odac error connecting to the database.
Delphi with odac error connecting to the database.

Time:10-04

This is the code:
Put five Edit used to input the database information,
Procedure TForm1. Button3Click (Sender: TObject);
The begin
Try
OraSession.Options.Net:=True;

OraSession. UserName:=Edit4. Text;
OraSession. PassWord:=Edit5. Text;
OraSession. Server:=Edit1. Text + + Edit2. ':'. '/' Text + + Edit3 Text;

OraSession. Connect;
Memo1. Lines. The Add (' connection database successful ');
Except,
On E: the Exception do begin
Memo1. Lines. The Add (' read a connection fails! '+ E.M essage);
end;
end;
end;

An error ORA - 12571

CodePudding user response:

OraSession. Server:=Edit1. Text + + Edit2. ':'. '/' Text + + Edit3 Text;
OraSession. Options. Direct:=True;
OraSession. Connectprompt:=false
OraSession. Connect;
So try

CodePudding user response:

reference 1st floor loen113 response:
OraSession. Server:=Edit1. Text + + Edit2. ':'. '/' Text + + Edit3 Text;
OraSession. Options. Direct:=True;
OraSession. Connectprompt:=false
OraSession. Connect;
So try


OraSession. Options. Direct:=True; This attribute
No plus OraSession. Connectprompt:=false or useless,

CodePudding user response:

 
OraSession1. Server:='192.168.2.173:1521: wouldn';
OraSession1. Username:='test';
OraSession1. Password:='test';
OraSession1. Options. Direct:=True;
OraSession1.Options.Net:=True;
OraSession1. Connectprompt:=false;
OraSession1. Connected:=True;

CodePudding user response:

Var
The Session: TOraSession;
...
The Session. The Options. Direct:=True;
The Session. Username:='Scott';
Session Password:='tiger';
The Session. Server:='205.227.44.44:1521: wouldn';
The Session. The Connect;
For the connection using the SID:
.
The Session. Server:='205.227.44.44:1521: sid=wouldn';
.

For the connection using the Service Name:
.
The Session. Server:='205.227.44.44:1521: sn=wouldn';

CodePudding user response:

Data source configuration?

CodePudding user response:

TOraSession is what bird control?

CodePudding user response:

Configure odbc, ADOConnection can connect

CodePudding user response:

Haven't seen OraSession indeed

CodePudding user response:

This machine is a problem with the odbc
  • Related