Discussion:
DCOM and ODBC
(too old to reply)
Jay
2003-11-12 15:21:16 UTC
Permalink
Hello,

I am using ODBC to connect to a SQL server 6.5 .
I have clientUI and server.exe(DCOM server) on "Server" box. Server.exe
accesses the Database on the "DB" box.
Everything works fine on the "server" box and I can run ClientUI properly.
Now, I copy the ClientUI to 'Client" box. Using dcomcnfg, I run the
server.exe on the "server" box.
When I do this, I get ODBC error.
"Login failed. Not defined as a valid user of a trusted sql server
connection".

I should be using trusted connections only.
And the NT login I am using on 'client' box and the 'server' box are the
same.

Please help!
Brian Muth
2003-11-12 16:52:25 UTC
Permalink
Is the DCOM server running as an executable or a service? Is it calling
CoInitializeSecurity or are you relying on the DCOMCNFG settings? What is
the security context of the executable?
Post by Jay
Hello,
I am using ODBC to connect to a SQL server 6.5 .
I have clientUI and server.exe(DCOM server) on "Server" box. Server.exe
accesses the Database on the "DB" box.
Everything works fine on the "server" box and I can run ClientUI properly.
Now, I copy the ClientUI to 'Client" box. Using dcomcnfg, I run the
server.exe on the "server" box.
When I do this, I get ODBC error.
"Login failed. Not defined as a valid user of a trusted sql server
connection".
I should be using trusted connections only.
And the NT login I am using on 'client' box and the 'server' box are the
same.
Please help!
Jay
2003-11-12 17:01:28 UTC
Permalink
DCOM is running as a exe.
It is NOT calling coinitializesecurity().
I am using DCOMCNFG for the settings.
Although I havent changed anything in the settings, except the location.
Post by Brian Muth
Is the DCOM server running as an executable or a service? Is it calling
CoInitializeSecurity or are you relying on the DCOMCNFG settings? What is
the security context of the executable?
Post by Jay
Hello,
I am using ODBC to connect to a SQL server 6.5 .
I have clientUI and server.exe(DCOM server) on "Server" box. Server.exe
accesses the Database on the "DB" box.
Everything works fine on the "server" box and I can run ClientUI properly.
Now, I copy the ClientUI to 'Client" box. Using dcomcnfg, I run the
server.exe on the "server" box.
When I do this, I get ODBC error.
"Login failed. Not defined as a valid user of a trusted sql server
connection".
I should be using trusted connections only.
And the NT login I am using on 'client' box and the 'server' box are the
same.
Please help!
Brian Muth
2003-11-12 17:23:04 UTC
Permalink
Usually the DCOM server should be running under a particular account that
has access to the SQL Server. I'm assuming SQL Server is set up to use
Integrated Windows Authentication... if not you will need to correct your
connection string.

Use DCOMCNFG to establish DCOM server to run under a specific account. By
default it runs as the calling user.
Post by Jay
DCOM is running as a exe.
It is NOT calling coinitializesecurity().
I am using DCOMCNFG for the settings.
Although I havent changed anything in the settings, except the location.
Post by Brian Muth
Is the DCOM server running as an executable or a service? Is it calling
CoInitializeSecurity or are you relying on the DCOMCNFG settings? What is
the security context of the executable?
Post by Jay
Hello,
I am using ODBC to connect to a SQL server 6.5 .
I have clientUI and server.exe(DCOM server) on "Server" box. Server.exe
accesses the Database on the "DB" box.
Everything works fine on the "server" box and I can run ClientUI
properly.
Post by Brian Muth
Post by Jay
Now, I copy the ClientUI to 'Client" box. Using dcomcnfg, I run the
server.exe on the "server" box.
When I do this, I get ODBC error.
"Login failed. Not defined as a valid user of a trusted sql server
connection".
I should be using trusted connections only.
And the NT login I am using on 'client' box and the 'server' box are the
same.
Please help!
Jay
2003-11-12 17:36:45 UTC
Permalink
I am running both the client and server using my account on both the boxes.
I also tried, setting the "identity" in dcomconfig to be the one that has
access to the database.
nothing works. What else do I need to change?
Post by Brian Muth
Usually the DCOM server should be running under a particular account that
has access to the SQL Server. I'm assuming SQL Server is set up to use
Integrated Windows Authentication... if not you will need to correct your
connection string.
Use DCOMCNFG to establish DCOM server to run under a specific account. By
default it runs as the calling user.
Post by Jay
DCOM is running as a exe.
It is NOT calling coinitializesecurity().
I am using DCOMCNFG for the settings.
Although I havent changed anything in the settings, except the location.
Post by Brian Muth
Is the DCOM server running as an executable or a service? Is it calling
CoInitializeSecurity or are you relying on the DCOMCNFG settings? What
is
Post by Jay
Post by Brian Muth
the security context of the executable?
Post by Jay
Hello,
I am using ODBC to connect to a SQL server 6.5 .
I have clientUI and server.exe(DCOM server) on "Server" box.
Server.exe
Post by Jay
Post by Brian Muth
Post by Jay
accesses the Database on the "DB" box.
Everything works fine on the "server" box and I can run ClientUI
properly.
Post by Brian Muth
Post by Jay
Now, I copy the ClientUI to 'Client" box. Using dcomcnfg, I run the
server.exe on the "server" box.
When I do this, I get ODBC error.
"Login failed. Not defined as a valid user of a trusted sql server
connection".
I should be using trusted connections only.
And the NT login I am using on 'client' box and the 'server' box are
the
Post by Jay
Post by Brian Muth
Post by Jay
same.
Please help!
Jay
2003-11-12 17:41:18 UTC
Permalink
In the "ODBC datasources" in the control panel, I am trying to set the
Client configuration->network libraries to use namedpipes instead of TCP/IP.
somehow the setting keeps changing to TCP/IP..May be if I can get this set
to named pipes, the client will work.
But how can I set it to Named pipes?
Post by Brian Muth
Usually the DCOM server should be running under a particular account that
has access to the SQL Server. I'm assuming SQL Server is set up to use
Integrated Windows Authentication... if not you will need to correct your
connection string.
Use DCOMCNFG to establish DCOM server to run under a specific account. By
default it runs as the calling user.
Post by Jay
DCOM is running as a exe.
It is NOT calling coinitializesecurity().
I am using DCOMCNFG for the settings.
Although I havent changed anything in the settings, except the location.
Post by Brian Muth
Is the DCOM server running as an executable or a service? Is it calling
CoInitializeSecurity or are you relying on the DCOMCNFG settings? What
is
Post by Jay
Post by Brian Muth
the security context of the executable?
Post by Jay
Hello,
I am using ODBC to connect to a SQL server 6.5 .
I have clientUI and server.exe(DCOM server) on "Server" box.
Server.exe
Post by Jay
Post by Brian Muth
Post by Jay
accesses the Database on the "DB" box.
Everything works fine on the "server" box and I can run ClientUI
properly.
Post by Brian Muth
Post by Jay
Now, I copy the ClientUI to 'Client" box. Using dcomcnfg, I run the
server.exe on the "server" box.
When I do this, I get ODBC error.
"Login failed. Not defined as a valid user of a trusted sql server
connection".
I should be using trusted connections only.
And the NT login I am using on 'client' box and the 'server' box are
the
Post by Jay
Post by Brian Muth
Post by Jay
same.
Please help!
Brian Muth
2003-11-12 20:22:46 UTC
Permalink
This appears to be a problem with establishing a proper ODBC connection, and
really has nothing to do with DCOM if your client can successfully
communicate with the server.

Here's a little trick I learned for both building the appropriate connection
string, and testing the connection:

Use Notepad to create an empty file with the name MyConnection.udl. Now
double-click on the filename. This will launch a wizard you can use for
building your connection string. On the Connection tab check the "Use
Connection String" radio button. Note that on this property page, you can
also set the user account credentials and then test the connection. Close
the wizard and inspect the contents of MyConnection.udl with Notepad. This
will be your connection string.

I have to admit I don't use ODBC very much, in preference to OLE DB drivers,
so perhaps some others can correct my steps. I also prefer not lugging
around a DSN file; you will find you can simply open the file with a text
editor, and use the contents as part of your connection string.

HTH,

Brian
Jay
2003-11-14 20:40:05 UTC
Permalink
I had to set the dcomcnfg on the server box instead of the client box.
That fixed the problem.

But now, I have a new problem trying to configure DCOM on another box.
I am not able to start up the DCOM server at all. I get "Server execution
failed" error.
Post by Brian Muth
This appears to be a problem with establishing a proper ODBC connection, and
really has nothing to do with DCOM if your client can successfully
communicate with the server.
Here's a little trick I learned for both building the appropriate connection
Use Notepad to create an empty file with the name MyConnection.udl. Now
double-click on the filename. This will launch a wizard you can use for
building your connection string. On the Connection tab check the "Use
Connection String" radio button. Note that on this property page, you can
also set the user account credentials and then test the connection. Close
the wizard and inspect the contents of MyConnection.udl with Notepad. This
will be your connection string.
I have to admit I don't use ODBC very much, in preference to OLE DB drivers,
so perhaps some others can correct my steps. I also prefer not lugging
around a DSN file; you will find you can simply open the file with a text
editor, and use the contents as part of your connection string.
HTH,
Brian
Brian Muth
2003-11-14 21:49:47 UTC
Permalink
What are your DCOMCNFG settings, on both the client and the server? On the
client, what is the authentication level?
Post by Jay
I had to set the dcomcnfg on the server box instead of the client box.
That fixed the problem.
But now, I have a new problem trying to configure DCOM on another box.
I am not able to start up the DCOM server at all. I get "Server execution
failed" error.
Post by Brian Muth
This appears to be a problem with establishing a proper ODBC connection,
and
Post by Brian Muth
really has nothing to do with DCOM if your client can successfully
communicate with the server.
Here's a little trick I learned for both building the appropriate
connection
Post by Brian Muth
Use Notepad to create an empty file with the name MyConnection.udl. Now
double-click on the filename. This will launch a wizard you can use for
building your connection string. On the Connection tab check the "Use
Connection String" radio button. Note that on this property page, you can
also set the user account credentials and then test the connection. Close
the wizard and inspect the contents of MyConnection.udl with Notepad. This
will be your connection string.
I have to admit I don't use ODBC very much, in preference to OLE DB
drivers,
Post by Brian Muth
so perhaps some others can correct my steps. I also prefer not lugging
around a DSN file; you will find you can simply open the file with a text
editor, and use the contents as part of your connection string.
HTH,
Brian
Brian Muth
2003-11-21 00:29:48 UTC
Permalink
Jay, any update?

Loading...