RE: Connection error SQLSetConnectAttr failed



I don't think I've ever seen machine and database names be numeric values.
Are you sure it's valid? Also, the database name should be contained in the
DSN when you created it.

Also, don't you need the User name and password? Perhaps I'm only thinking
of SQL Server.

Try looking at what's in the DSN by opening the registry and looking at the
DSN under ....\Software\ODBC\ODBC.INI

Anyone else have any ideas?

--------------------
| Thread-Topic: Connection error SQLSetConnectAttr failed
| thread-index: AcW0LLjqa4rj0V3rSISaJ0/k4CWJ3Q==
| X-WBNR-Posting-Host: 67.184.170.24
| From: "=?Utf-8?B?Sm9zaA==?=" <Josh@xxxxxxxxxxxxxxxxxxxxxxxxx>
| Subject: Connection error SQLSetConnectAttr failed
| Date: Wed, 7 Sep 2005 21:21:02 -0700
| Lines: 70
| Message-ID: <617E3E23-1E6C-47C2-BBBC-1F69F4BDD6D7@xxxxxxxxxxxxx>
| MIME-Version: 1.0
| Content-Type: text/plain;
| charset="Utf-8"
| Content-Transfer-Encoding: 7bit
| X-Newsreader: Microsoft CDO for Windows 2000
| Content-Class: urn:content-classes:message
| Importance: normal
| Priority: normal
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.0
| Newsgroups: microsoft.public.data.odbc
| NNTP-Posting-Host: TK2MSFTNGXA03.phx.gbl 10.40.2.250
| Path: TK2MSFTNGXA02.phx.gbl!TK2MSFTNGXA03.phx.gbl
| Xref: TK2MSFTNGXA02.phx.gbl microsoft.public.data.odbc:21093
| X-Tomcat-NG: microsoft.public.data.odbc
|
| Not sure exactly where to post this question..figured I would start here.
|
| I have an undocumented ODBC driver..Or the supplier at least won't give
me
| much. The most I can find is a list of tables on the server, everything
else
| seems to be some sort of secret I guess.
| I'm using a system DSN
| Can connect through MS office applications no problem.
| Want to connect programatically through .NET
|
| I'm using C# as my language of choice.
|
| I've created three different types of apps to connect through this driver
| using the same connect strings in .NET. Here is the situation
|
| Windows form works OK
| Web form(.AXPX w/ C# codebehind) and Windows Service I get the following
| error:
|
| ERROR [S1000] [Simba][SimbaEngine ODBC Driver][DRM File Library]Error
| occured while opening the Network, contact your System Administror. ERROR
| [IM006] [Microsoft][ODBC Driver Manager] Driver's SQLSetConnectAttr
failed
| ERROR [01000] [Microsoft][ODBC Driver Manager] The driver doesn't support
the
| version of ODBC behavior that the application requested (see
SQLSetEnvAttr).
|
| Here is some code tied to a button on a webform I use to make the failing
| connection. Just enough to open, report the error, and close it.
|
| <CODE>
| using system.data.odbc //and some others too :->
| string ucsconnectstring = "DSN=UCS;Machine=490001;Database=490001";
| OdbcConnection conn = new OdbcConnection(ucsconnectstring);
| try
| {
| conn.Open();
| }
|
| catch(Exception e)
| {
| lblError.Text = "FAILED";
| lblError.Text +="<BR>";
| lblError.Text += e.Source.ToString();
| lblError.Text +="<BR>";
| lblError.Text += e.Message.ToString();
| }
| finally
| {
| conn.Close();
| }
|
| </CODE>
|
|
| After lots of reading I see posts on the net about user rights, but that
| doesn't seem to solve it. In the service I have it set to run as me,
domain
| admin rights and get the same error.
|
| I've also found an artical that hinted to the fact that it may be because
| this is a READ ONLY ODBC driver(IE I can only SELECT data) but that was
just
| a hint.
|
|
| Ideally I would like to query a the database that this ODBC driver
connects
| to and copy the data on a scheduled interval to a faster SQL server for
| reporting, and would prefer to do it via windows service.
|
| Anyhow let me know if you have an idea, another resource, or a way to get
a
| more descriptive error. I've ask pretty much the same question on
| www.asp.net without any luck.
|
|
|

.


Loading