Ahmadi
2008-05-07 09:48:47 UTC
Hi
Im using D2007+SQLServer 2005+dbExpress driver(and dbx controls)
I have one error while running a query with following code:
...
mQuery.SQL.Clear;
mQuery.SQL.Add(sqlcommand);
try
mQuery.ExecSQL(true);
except
on E: Exception do
showmessage(E.Message);
end;
...
the error message is "DBX Error: Error Code: 16389)" , i can not
understand what this mean?
also google have no info about this error message.
16389 is not fix and is variable ! (seem that is a random number)
How can i catch DBMS error !?
Here is a sample query(that insert N records to table1):
Insert into table1 fields(f1,f2,f3) values ('field1','field2','1');
...
Insert into table1 fields(f1,f2,f3) values ('field1','field2','N');
consider that query have error(duplicate key value).
if i catch the error : error message ="DBX Error: Error Code: 16389)" , is
not a good information
But if i run this query with SQL Management Studio , the error is "You can
not insert duplicate record", and is very good information.
the above sample is only one sample, and is not my problem, just show my
problem
my problem is that i want to catch complete error message from DBMS such as
SQL Server Management Studio.
Thanks for any help
~~~~~~~~~~~
Best Regards
H.Ahmadi
Im using D2007+SQLServer 2005+dbExpress driver(and dbx controls)
I have one error while running a query with following code:
...
mQuery.SQL.Clear;
mQuery.SQL.Add(sqlcommand);
try
mQuery.ExecSQL(true);
except
on E: Exception do
showmessage(E.Message);
end;
...
the error message is "DBX Error: Error Code: 16389)" , i can not
understand what this mean?
also google have no info about this error message.
16389 is not fix and is variable ! (seem that is a random number)
How can i catch DBMS error !?
Here is a sample query(that insert N records to table1):
Insert into table1 fields(f1,f2,f3) values ('field1','field2','1');
...
Insert into table1 fields(f1,f2,f3) values ('field1','field2','N');
consider that query have error(duplicate key value).
if i catch the error : error message ="DBX Error: Error Code: 16389)" , is
not a good information
But if i run this query with SQL Management Studio , the error is "You can
not insert duplicate record", and is very good information.
the above sample is only one sample, and is not my problem, just show my
problem
my problem is that i want to catch complete error message from DBMS such as
SQL Server Management Studio.
Thanks for any help
~~~~~~~~~~~
Best Regards
H.Ahmadi