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