DB2 Connection Issue

G

Guest

I can connect to one db2 database through my application just fine. But when
I attempt to connect to another database in another application, I am getting
errors. When I create the connection object, I see the following on the
"ServerVersion" property: "ServerVersion = '_OledbConn.ServerVersion' threw
an exception of type 'System.InvalidOperationException'", but it throws not
exception. When I create a command object and attempt to execute the
command, I then do get an exceptions of "[System.Data.OleDb.OleDbException] =
{" SQL1013N The database alias name or database name \"\" could not be
found. SQLSTATE=42705"}".

If I go to my desktop and create a ".udl" object to connect to the database,
it connects just fine. I took the information out of this file and used it
for my connection object. Likewise, if I go into the control panel and go
into the ODBC connections, I can connect to this data source just fine.

The db2 table that I am able to successfully able to connect to is on
another box, but I'm not sure that has to do with anything.

Any ideas?
 
F

Frans Bouma [C# MVP]

JimHeavey said:
I can connect to one db2 database through my application just fine.
But when I attempt to connect to another database in another
application, I am getting errors. When I create the connection
object, I see the following on the "ServerVersion" property:
"ServerVersion = '_OledbConn.ServerVersion' threw an exception of
type 'System.InvalidOperationException'", but it throws not
exception. When I create a command object and attempt to execute the
command, I then do get an exceptions of
"[System.Data.OleDb.OleDbException] = {" SQL1013N The database alias
name or database name \"\" could not be found. SQLSTATE=42705"}".

If I go to my desktop and create a ".udl" object to connect to the
database, it connects just fine. I took the information out of this
file and used it for my connection object. Likewise, if I go into
the control panel and go into the ODBC connections, I can connect to
this data source just fine.

The db2 table that I am able to successfully able to connect to is on
another box, but I'm not sure that has to do with anything.

Any ideas?

Well, it might be wise to use the native DB2 provider from IBM. It's
in the latest client-access client.

FB

--
------------------------------------------------------------------------
Lead developer of LLBLGen Pro, the productive O/R mapper for .NET
LLBLGen Pro website: http://www.llblgen.com
My .NET blog: http://weblogs.asp.net/fbouma
Microsoft MVP (C#)
------------------------------------------------------------------------
 
G

Guest

Do you have IBM's DB2 connect in the machine where the Data Access component
lives
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top