By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
431,795 Members | 1,216 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 431,795 IT Pros & Developers. It's quick & easy.

[IM006] [Microsoft][ODBC Driver Manager] Driver's SQLSetConnectAttr failed

P: n/a
Hello,

I'm creating a webservice that needs to query an Access database (mdb).
Here's my code:

OdbcConnection *pConnection = new OdbcConnection("Driver={Microsoft Access
Driver (*.mdb)};DSN=MyDatasource");
try
{
pConnection->Open();
}
catch(OdbcException *e)
{
Console::WriteLine("An error occurred: '{0}'", e);
}
This always throws an exception with the message : [IM006][Microsoft][ODBC
Driver Manger]Driver's SQLSetConnectAttr failed

I have granted the ASPNET user account Administrative privileges to no
avail. I'm pretty much a web service security noob at this point so help
would be greatly appreciated.

Thanks!
Nov 23 '05 #1
Share this Question
Share on Google+
4 Replies


P: n/a
Hello cipher,
Check if your DSN is a system dsn

HTH
Regards,
Dilip Krishnan
MCAD, MCSD.net
dkrishnan at geniant dot com
http://www.geniant.com
Hello,

I'm creating a webservice that needs to query an Access database
(mdb). Here's my code:

OdbcConnection *pConnection = new OdbcConnection("Driver={Microsoft
Access
Driver (*.mdb)};DSN=MyDatasource");
try
{
pConnection->Open();
}
catch(OdbcException *e)
{
Console::WriteLine("An error occurred: '{0}'", e);
}
This always throws an exception with the message :
[IM006][Microsoft][ODBC Driver Manger]Driver's SQLSetConnectAttr
failed

I have granted the ASPNET user account Administrative privileges to no
avail. I'm pretty much a web service security noob at this point so
help would be greatly appreciated.

Thanks!

Nov 23 '05 #2

P: n/a
Hi,

It was a User DSN but after making it a System DSN there was no change in
behavior. Same error.

"Dilip Krishnan" <dk*******@NOSPAM.geniant.com> wrote in message
news:14**********************@msnews.microsoft.com ...
Hello cipher,
Check if your DSN is a system dsn

HTH
Regards,
Dilip Krishnan
MCAD, MCSD.net
dkrishnan at geniant dot com
http://www.geniant.com
Hello,

I'm creating a webservice that needs to query an Access database
(mdb). Here's my code:

OdbcConnection *pConnection = new OdbcConnection("Driver={Microsoft
Access
Driver (*.mdb)};DSN=MyDatasource");
try
{
pConnection->Open();
}
catch(OdbcException *e)
{
Console::WriteLine("An error occurred: '{0}'", e);
}
This always throws an exception with the message :
[IM006][Microsoft][ODBC Driver Manger]Driver's SQLSetConnectAttr
failed

I have granted the ASPNET user account Administrative privileges to no
avail. I'm pretty much a web service security noob at this point so
help would be greatly appreciated.

Thanks!


Nov 23 '05 #3

P: n/a
Hello cipher,
Yr connection string is probably wrong
try something like this... "mySystemDSN;Uid=myUsername;Pwd=myPassword"

HTH
Regards,
Dilip Krishnan
MCAD, MCSD.net
dkrishnan at geniant dot com
http://www.geniant.com
Hi,

It was a User DSN but after making it a System DSN there was no change
in behavior. Same error.

"Dilip Krishnan" <dk*******@NOSPAM.geniant.com> wrote in message
news:14**********************@msnews.microsoft.com ...
Hello cipher,
Check if your DSN is a system dsn
HTH
Regards,
Dilip Krishnan
MCAD, MCSD.net
dkrishnan at geniant dot com
http://www.geniant.com
Hello,

I'm creating a webservice that needs to query an Access database
(mdb). Here's my code:

OdbcConnection *pConnection = new OdbcConnection("Driver={Microsoft
Access
Driver (*.mdb)};DSN=MyDatasource");
try
{
pConnection->Open();
}
catch(OdbcException *e)
{
Console::WriteLine("An error occurred: '{0}'", e);
}
This always throws an exception with the message :
[IM006][Microsoft][ODBC Driver Manger]Driver's SQLSetConnectAttr
failed
I have granted the ASPNET user account Administrative privileges to
no avail. I'm pretty much a web service security noob at this point
so help would be greatly appreciated.

Thanks!

Nov 23 '05 #4

P: n/a
Dilip,

You were correct, the connection string was wrong. It seems the Driver
portion is correct and is required. I still don't know what is wrong with
the one I was using but I changed it to this:

pConnection = new OdbcConnection("Driver={Microsoft Access Driver
(*.mdb)};DBQ=c:\\mydata.mdb");

and all is well. Thanks for your help.

"Dilip Krishnan" <dk*******@NOSPAM.geniant.com> wrote in message
news:14**********************@msnews.microsoft.com ...
Hello cipher,
Yr connection string is probably wrong
try something like this... "mySystemDSN;Uid=myUsername;Pwd=myPassword"

HTH
Regards,
Dilip Krishnan
MCAD, MCSD.net
dkrishnan at geniant dot com
http://www.geniant.com
Hi,

It was a User DSN but after making it a System DSN there was no change
in behavior. Same error.

"Dilip Krishnan" <dk*******@NOSPAM.geniant.com> wrote in message
news:14**********************@msnews.microsoft.com ...
Hello cipher,
Check if your DSN is a system dsn
HTH
Regards,
Dilip Krishnan
MCAD, MCSD.net
dkrishnan at geniant dot com
http://www.geniant.com
Hello,

I'm creating a webservice that needs to query an Access database
(mdb). Here's my code:

OdbcConnection *pConnection = new OdbcConnection("Driver={Microsoft
Access
Driver (*.mdb)};DSN=MyDatasource");
try
{
pConnection->Open();
}
catch(OdbcException *e)
{
Console::WriteLine("An error occurred: '{0}'", e);
}
This always throws an exception with the message :
[IM006][Microsoft][ODBC Driver Manger]Driver's SQLSetConnectAttr
failed
I have granted the ASPNET user account Administrative privileges to
no avail. I'm pretty much a web service security noob at this point
so help would be greatly appreciated.

Thanks!


Nov 23 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.

Browse more .NET Framework Questions on Bytes