Linked server to ODBC DSN

From: Ian Boyd (ian.msnews010_at_avatopia.com)
Date: 07/30/04


Date: Fri, 30 Jul 2004 15:36:59 -0400

i have a DSN created on the SQL Server machine itself. Using my favorite
ODBC sql query tool, i can select the System DSN, specify a login and
password, and type a select statement and it all works. i go into SQL
Server, and want to create a linked server to this same ODBC DSN:

Linked server = "BALLYS"
Provider = "Microsoft OLE DB Provider for ODBC Driver"
Data Source="WC400B Bally CMS Testing"
Security-Be made using this security context:
    Remote login= [Login Name]
    With Password= [Password is blank]

Then i connect to the SQL Server using QA, and try to run my query (that
works in my favorite generic ODBC query tool):

SELECT * FROM OPENQUERY(BALLYS, 'select * from cspcm')

And i get an error message. Now, the error message really shouldn't matter.
My question is, why does it not work? Why didn't the linked server work? If
any generic 3rd party tool can login and run queries fine, why isn't SQL
Server?

But if you care, the error message is:

Server: Msg 7399, Level 16, State 1, Line 1
OLE DB provider 'MSDASQL' reported an error.
[OLE/DB provider returned message: [IBM][Client Access Express ODBC Driver
(32-bit)][DB2/400 SQL]General error.]
[OLE/DB provider returned message: [Microsoft][ODBC Driver Manager] Driver's
SQLSetConnectAttr failed]
[OLE/DB provider returned message: [Microsoft][ODBC Driver Manager] Driver's
SQLSetConnectAttr failed]
[OLE/DB provider returned message: [IBM][Client Access Express ODBC Driver
(32-bit)][DB2/400 SQL]Communication link failure. Comm RC=4 - CWB0999 -
Unexpected error: unexpected return code 4]
OLE DB error trace [OLE/DB Provider 'MSDASQL' IDBInitialize::Initialize
returned 0x80004005: ].

Now obviously the DB2 ODBC driver works fine, since i can use it fine with
ADO in my own programs, as well as any other program that knows how to use
ODBC.

So what is SQL Server doing wrong?

Here are all the settings for my linked server setup:

Provider name: Microsoft OLE DB Provider for ODBC Drivers
Product name: [blank]
Data source: WC400B Bally CMS Testing
Provider string: [blank]
Location: [blank]
Catalog: [blank]

Provider Options:
    Dynamic parameters: Unchecked
    Nested queries: Unchecked
    Level zero only: Unchecked
    Allow InProcess: Checked
    Non transacted updates: Unchecked
    Index as access path: Unchecked
    Disallow adhoc accesses: Unchecked

Be made using this security contect:
     Remote Login: [The login]
    With password: [blank - the password is empty]

Server Options:
    Collation compatibile: Unchecked
    Data Access: Checked
    RPC: Unchecked
    RPC Out: Unchecked
    Use remote connection: Checked
    Collation Name: [blank]
    Connection Timeout: 0
    Query Timeout: 0

Everything is defaulted, aside from the OLEDB Provider Name, the DSN, the
login, and password.

Which of these defaults are wrong, and are preventing SQL Server from
connecting to a remote ODBC data source?



Relevant Pages

  • Re: Is TDS used only if server is local?
    ... Even if it was so small, do you have a reason to prefer ODBC to the .NET ... I would see things the other way round, using the .NET provider unless I ... If TDS are the actual data, ... CFMX accessing SQL Server stored procedures via ODBC SQL Server ...
    (microsoft.public.dotnet.framework.adonet)
  • Re: SQL Server extremely slow
    ... terms of what is meant by a dis-connected ado recordset. ... table in a mdb file could be considered disconnected from the server ... Well, ok, but keep in mind the disk drive is on sql server! ... 10 reocrds from the server via odbc does not produce more ...
    (comp.databases.ms-access)
  • Re: DMX cmd cant see Access db
    ... You are using SQL Server Management Studio, ... It looks like the error is coming from the Access provider. ... I'm trying to follow the examples from Chapter 5 of "Data Mining With SQL ...
    (microsoft.public.sqlserver.datamining)
  • Re: DAO vs ADO
    ... > to re-write it at least a little but can I do it in DAO? ... > tables were on a SQL Server! ... ODBC, one table could be on the corporate server, and the other ODBC might ...
    (microsoft.public.access.conversion)
  • Re: error setting up ODBC for remote sqlexpress database
    ... We were able to get it to work with the ODBC native client driver. ... Server could be stopped in the client. ... is to install Management Studio for SQL Server 2005 Express ...
    (microsoft.public.sqlserver.odbc)