ODBC Connection failed when using OPENROWSET 
Author Message
 ODBC Connection failed when using OPENROWSET

Hi all,

I'm trying to run this code below but keeping getting an error.  I also
tried to create a storedProcedure with the same SQL but I get the same
error.

The DB is SQLSERVER7 with a machine DSN setup on my workstation called
AUCTION_ORACLE_WEB.  The OPENROWSET works great within TSQL but not within
my VB6 app.

----------------------------------------------------------------------------
----
OPENSQLSERVER
'Oracle
Tx = "SELECT distinct(LastFirst) FROM
OPENROWSET('MSDAORA','PTADEV';'WEBAUC';'WEBAUC',"
Tx = Tx & " " & Chr(34) & "Select * from Auction_win_tbl where
remoteusername='LocalUser'"
Tx = Tx & " order by netid" & Chr(34) & ")A,"
Tx = Tx & " userinfo_view B where A.netid=B.netid  order by lastfirst"
'In Oracle you can not open two tables from different servers.  So instead I
elected to bring back
'all active employees regardless if they won samples or not
'Tx = "Select * from UserInfo_View where status='A' order by NETID"
'Tx = "AUCTION_WINNER_NAMES"

If CnSQL.StillExecuting = False Then
    Set QrSQL = Nothing
    Set RS2 = Nothing
    Set QrSQL.ActiveConnection = CnSQL
End If
QrSQL.SQL = Tx

Set RS2 = QrSQL.OpenResultset(rdOpenKeyset, rdConcurBatch)
----------------------------------------------------------------------------
-----

But keep getting this error:

----------------------------------------------------------------------------
-----------
Error 40002: 37000: [Microsoft][ODBC SQL Server Driver][SQL Server]Ad hoc
access to OLE DB provider 'MSDAORA' has been denied. You must access this
provider through a linked server.
----------------------------------------------------------------------------
-----------

Any help would be appreciated.  Thanks.



Mon, 22 Aug 2005 04:00:00 GMT  
 
 [ 1 post ] 

 Relevant Pages 

1. Connection Fail after installation - dbnmpntw write() connection fail

2. Connection Fail after installation - dbnmpntw write() connection fail

3. ODBC connections using ODBC

4. ODBC connection to <name> failed

5. ODBC call failed using ODBCDirect

6. SQL String of 922-926 characters fails using ADO and ODBC

7. PRB: ODBC -- Call failed (VB5 -- ODBC -- Access97)

8. Actual ODBC error codes rather than 3146 -- ODBC Call failed

9. Actual ODBC error codes rather than 3146 -- ODBC Call failed

10. [ODBC Microsoft Access Driver] ODBC--call failed.

11. [ODBC Microsoft Access Driver] ODBC--call failed.

12. ADO connection passed to a DLL fails to maintain valid connection

 

 
Powered by phpBB® Forum Software