I am using Delphi5 and ODAC components.
The problem is: I moved all my functions to Util file and created instance of TOraQuery in one of the my main function in Util file and session component is residing in the file who includes Util file. So when I run my application i get this error "raised EOraError exception with message 'NET:Unknown error 1' " or "raised EDBError exception with message 'Unknown error 1' " what does this error means ? i searched on the internet and could not find any valuable information. In the session Net is checked.
Below is my code samples
Util file
Code: Select all
var
OraQADB: TOraQuery;
procedure process_given_form(f:TForm);
....
....
OraQADB:= TOraQuery.Create(f);
OraQADB.AutoCommit:=True;
...
end;
//Add component to the database
procedure addComponentToDB(obj:TControl);
var qstring,tid,path,cname,capLang: String;
begin
path:= prName+getPath(obj);
cname:= obj.Name;
if(not(checkComponentPath(path,cname))) then
begin
OraQADB.Close;
OraQADB.SQL.Clear;
OraQADB.SQL.Add('SELECT PERSONEL.SQX_TID.NEXTVAL AS TID FROM DUAL');
OraQADB.ExecSQL;
tid:= OraQADB.FieldByName('TID').AsString;
capLang:= getComponentCaption(obj);
qstring:='INSERT INTO PERSONEL.TRANSLATIONS (TID,SCRIPT_NAME,TAG,TR,EN,LOCAL) VALUES ('''+tid+''','''+path+''','''+cname+''','''+capLang+''','''+'English'+''','''+'Local Lang'''+')';
//showMessage(qstring);
OraQADB.Close;
OraQADB.SQL.Clear;
OraQADB.SQL.Add(qstring);
OraQADB.ExecSQL;
end;
end;
//check availability of the Componets path
function checkComponentPath(path:String;cname:String):Boolean;
begin
OraQADB.Close;
OraQADB.SQL.Clear;
//if not assigned(OraQADB.Session) then showmessage('session yok');
//if not assigned(DefaultSession) then showmessage('default session yok');
OraQADB.SQL.Add('SELECT TAG FROM PERSONEL.TRANSLATIONS WHERE SCRIPT_NAME like '''+path+'''');
OraQADB.Open; // ERROR OCCURS WHILE EXECUTING THIS STATEMENT
if(cname = OraQADB.FieldByName('TAG').AsString) then
Result:=True
else
Result:=False;
end;
Code: Select all
var
OraSessPersonel: TOraSession;
....
uses Util
procedure TForm1.prItemClick(Sender: TObject);
begin
process_given_form(self);
end;thanks