Connection error SQLSetConnectAttr failed

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



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.


.


Quantcast