PDA

View Full Version : DSN MySql



boristheblade
September 29th, 2003, 06:19 PM
Hi - I need som help please!
I have Mysql running on my C drive

The web server is a on a local network Z drive running IIS.

I downloaded and installed the latest MyODBC.

I created a system DSN from control panel, and when I click on 'Test Data Source' I have success. But when I try to connect on my asp page, it gives me the following error.

Microsoft OLE DB Provider for ODBC Drivers error '80004005'

[Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified



here is my aspcode
<%
set conn=Server.CreateObject("ADODB.Connection")

conn.Open "chrisDSN"
%>

I greatly appreciate any help or advice. In a lot of trouble!! Thanks

Digitalosophy
September 29th, 2003, 06:29 PM
well your not connecting to any database here, thats why ur getting that error. not too sure on how to connect to a mySQL db with asp but you'll need soemthing liek this


MyPath=Server.MapPath("employees.mdb")
Set conn = Server.CreateObject("ADODB.Connection")
conn.Open "Driver={Microsoft Access Driver (*.mdb)};" & _
"DBQ=" & MyPath

boristheblade
September 29th, 2003, 06:37 PM
thanks for the input, however
I got the code to work using this code on my home computer. I got the code from this site:

http://www.w3schools.com/ado/ado_connect.asp


it is a dsn connection, so all I should have to do is make a system dsn with the with a name and then refer to it by that name in my asp. I think it is related to having sql on local c drive and the web host on network drive. Do I need to set up the dsn on the actual host machine?

Digitalosophy
September 29th, 2003, 06:47 PM
well i dont any experience in what ur trying to with the DSN. but in the DSN u created youll need to specify a connection.

sry but that's all i can offer