Board index » delphi » Problem querying a linked SQL Server through ADO

Problem querying a linked SQL Server through ADO

I have one SQL Server Database (dbA) which links to another (dbB).
This link works just fine with query analyzer.  However I am having a
problem utilizing this link from a delphi program.  I create an ADO
connection to dbA and then create a query which pulls data from dbB in
the form

select * from [ServerName].[dbB].[user].[tablename]

This query works perfectly in query analyzer.  I can connect to dbA
and run this query and get my results from dbB.  However, when I
activate the query in delphi (at design or runtime) I get the error:

Access violation at address XXXXXXXX in module 'MSVCRT.DLL'.  Read of
Address XXXXXXXX

Then I figured maybe ADO was having a problem interpreting the link so
I created a simple stored procedure on dbA which executed the same
statement.  This was all my delphi program would have to do is call a
stored procedure which would return the results.  This method yielded
the same error.  Can anyone tell me why querying my linked server is
giving me this error?
Thanks,
Jeff

 

Re:Problem querying a linked SQL Server through ADO


Quote
jburg...@sakon.com (goonsquad) wrote in message <news:e55b23eb.0201290756.59082e65@posting.google.com>...
> I have one SQL Server Database (dbA) which links to another (dbB).
> This link works just fine with query analyzer.  However I am having a
> problem utilizing this link from a delphi program.  I create an ADO
> connection to dbA and then create a query which pulls data from dbB in
> the form

> select * from [ServerName].[dbB].[user].[tablename]

> This query works perfectly in query analyzer.  I can connect to dbA
> and run this query and get my results from dbB.  However, when I
> activate the query in delphi (at design or runtime) I get the error:

> Access violation at address XXXXXXXX in module 'MSVCRT.DLL'.  Read of
> Address XXXXXXXX

> Then I figured maybe ADO was having a problem interpreting the link so
> I created a simple stored procedure on dbA which executed the same
> statement.  This was all my delphi program would have to do is call a
> stored procedure which would return the results.  This method yielded
> the same error.  Can anyone tell me why querying my linked server is
> giving me this error?
> Thanks,
> Jeff

AFAIK, inter-server querying is not possible unless you have a
transport mechanism in place.  I think M$ calls it Remote Processing
or some such thing.  Anyway, you won't be able to do that unless you
can get the connection to connect to both databases at the same time.
Failing that, it is a matter of rethink and rewrite.

-Jim

Other Threads