Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

DSN problem

Status
Not open for further replies.

webIntern

Programmer
Nov 22, 2002
40
0
0
US
Hi,

I'm using a DSN connection to a remote database in an ASP page. I know for sure the database exists but for some reason I get the following error:

Error Type:
Microsoft OLE DB Provider for ODBC Drivers (0x80004005)
[MySQL][ODBC 3.51 Driver]Unknown database 'ubb'
/ccweb/login.asp, line 53

I have the driver installed. It's not giving me a connection error, just "unknown database" when I know for sure that database exists. Here's my code:

var dbConnFor = Server.CreateObject("ADODB.Connection")
strConnection = "Driver={MySQL ODBC 3.51 Driver}; DSN=ubb-ccweb; DATABASE=ubb;"

dbConnFor.Open(strConnection)

It blows up on that last line.

Can someone help? I will post this in the ASP forum as well...

Thanks!
 
Couple of questions:

Can you override the database from that declared in the DSN ?
Have you tried using the DSN from another app e.g. MSQUERY or even a .vbs page called from cscript ?
Have you tried running ODBC tracing (switch on via odbc manager)
Try and do all this kind of stuff from the user that the web server fires off into .

regrards
 
can you tell me what you mean by "override" the database?
 
yes,

Normally you would specify the database name within the data source defintion in the odbc administrator, you have spefied database=ubb on the connect string. I may be wrong I dont have sqlserver so cant test it.
Your best bet may be to go for a DSN less connection where you spefiy all the connection details within the string. Have a look on the web for details.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top