Board index » delphi » Access vs. SQL Server in TADOConnection

Access vs. SQL Server in TADOConnection


2003-10-22 08:02:35 AM
delphi211
I am writing a .dll in Delphi that uses a TADOConnection.
I had a problem earlier with that ubiquitous error "Multiple-step OLE DB
operation generated errors. Check each OLE DB status value, if available. No
work was done" when I tried to call TADOConnection.Open();
Since this error happens when there is no intelligent message the system can
generate, this error message could literally be one of several thousand
reasons, possibly.. so.. to narrow down my problem I tried connecting to
other kinds of databases (such as SQL Server).
I am able to make a connection to any SQL Server database, but I am
incapable of connecting to Access databases. When I change the connection
string to point to an Access database, I get that error above.
Anyone have a clue as to why Access cannot be loaded like SQL Server can be?
PW
 
 

Re:Access vs. SQL Server in TADOConnection

"Perry Way" <XXXX@XXXXX.COM>schrieb im Newsbeitrag
Quote
I am writing a .dll in Delphi that uses a TADOConnection.

I had a problem earlier with that ubiquitous error "Multiple-step OLE DB
operation generated errors. Check each OLE DB status value, if available.
No
work was done" when I tried to call TADOConnection.Open();
go like this:
//
OutputDebugString(ADOConnection1.ConnectionString);
try
ADOConnection1.Open;
except
on E:Exception do
begin
// add all possible information
E.Message := E.Message+#13#10#13#10+GetAllADOErrors(ADOConnection1);
raise; // raise the exception again
end;
uses ...,ADOint;
function GetAllADOErrors(cn: TADOConnection):string;
var
i : Integer;
e : ADOInt.Errors;
begin
e := cn.ConnectionObject.Errors;
for i := 0 to e.Count-1 do
begin
Result := Result +
Format('#%d %s'#13, [e.item[i].Number, e.Item[i].Source]) + #13
+ e.Item[i].Description+#13+
e.Item[i].SQLState+#13;
end;
end;
Quote
I am able to make a connection to any SQL Server database, but I am
incapable of connecting to Access databases. When I change the connection
string to point to an Access database, I get that error above.
Please tell us the connectionstring.
hth
Andreas
 

Re:Access vs. SQL Server in TADOConnection

"Brian Bushay TeamB wrote
Quote
>I am able to make a connection to any SQL Server database, but I am
>incapable of connecting to Access databases. When I change the
connection
>string to point to an Access database, I get that error above.
>
>Anyone have a clue as to why Access cannot be loaded like SQL Server can
be?

You are not providing enough information to duplicate the problem.
I would bet you have an error in your connection string. How are you
generating
the connectionstring?
I used the wizard that pops up when you double click on a TADOConnection
component at design time.
Here's my connection strings.... nothing seems out of the ordinary to me...
Access: Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Documents and
Settings\pway\Desktop\db1.mdb;Persist Security Info=False
SQLServer: Provider=SQLOLEDB.1;Password=<hidden>;Persist Security
Info=True;User ID=<hidden>;Initial Catalog=OutReach;Data Source=PWHOME
PW
 

Re:Access vs. SQL Server in TADOConnection

"Andreas Schmidt" wrote
Quote
go like this:
<snip big chunk out>
Andreas, This is very interesting. I didn't know there was an interface
for grabbing all errors. Unfortunately in my case, this yielded in no more
information than the error string passed in the exception as there was only
one item in the Error interface.
Here is my extended error information...
Number: -2147217887
Source: Microsoft OLE DB Service Components
Description: Multiple-step OLE DB operation generated errors. Check each OLE
DB status value, if available. No work was done.
SQLState: <null>
Quote
Please tell us the connectionstring.
For SQLServer: Provider=SQLOLEDB.1;Password=<hidden>;Persist Security
Info=True;User ID=<hidden>;Initial Catalog=OutReach;Data Source=PWHOME
For Access: Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Documents and
Settings\pway\Desktop\db1.mdb;Persist Security Info=False
PW
 

Re:Access vs. SQL Server in TADOConnection

"Brian Bushay TeamB" wrote
Quote
>I used the wizard that pops up when you double click on a TADOConnection
>component at design time.
>
>Here's my connection strings.... nothing seems out of the ordinary to
me...
>
>Access: Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Documents and
>Settings\pway\Desktop\db1.mdb;Persist Security Info=False

If you are not modifying the connection string the Wizard generates then
that is
not likely to be your problem.
Do you have any ado components in the dll other than the Tadoconnection?
No, I do not. (Not yet).
PW
 

Re:Access vs. SQL Server in TADOConnection

"Perry Way" wrote
Quote

"Brian Bushay TeamB" wrote

>If you are not modifying the connection string the Wizard generates then
that is
>not likely to be your problem.
>Do you have any ado components in the dll other than the Tadoconnection?



No, I do not. (Not yet).

PW
I just tried another avenue in Hackville.. I tried putting a TADOConnection
on a form, and showing that form in a .dll export. Still the same error.
It seems hung up on Access.. not any other database connection. Strangely..
PW