Getting Error while connecting Oracle through DbExpress [Edi |
|
i'm getting access violation error while connection oracle through DbExpress. Below is my code,
(getting error when executing *Conn.Connected := true;* line)
{code}
procedure TForm1.Button1Click (Sender: TObject);
var
conn: TSQLConnection;
Query: TSQLQuery;
begin
Conn := TSQLConnection. Create (nil);
try
Conn.ConnectionName := 'OracleConnection';
Conn.DriverName := 'Oracle';
Conn.GetDriverFunc := 'getSQLDriverORACLE';
Conn.KeepConnection := true;
Conn.LibraryName := 'dbxora30.dll';
Conn.LoginPrompt := false;
Conn.VendorLib := 'oci.dll';
Conn.Params.Add ('HostName=orcl');
Conn.Params.Add ('Database=orcl126');
Conn.Params.Add ('User_Name=snt_live');
Conn.Params.Add ('Password=log');
*Conn.Connected := true;*
Query := TSQLQuery. Create (nil);
try
Query.SQLConnection := Conn;
Query.GetMetadata := true;
Query.CommandText := 'Select xmlagg ((xmlelement (e, docid || '','')).extract (''//text()'')).getclobval() '+
' from localgrnhdr lg, localgrndtl ld '+
' where lg.cancel = ''F'' and lg.localgrnhdrid = ld.localgrnhdrid and rownum <= 5';
Query.Open;
Query.First;
while not Query.Eof do begin
//do some thing
Query.Next;
end;
Query.Close;
finally
Query.Free;
end;
Conn.Connected := false;
finally
Conn.Free;
end;
end;
{code}
Please give me a solution.
Edited by: karthik thirumoorthi on Sep 24, 2014 4:41 AM
Edited by: karthik thirumoorthi on Sep 24, 2014 5:02 AM
|
Re: Getting Error while connecting Oracle through DbExpress |
|