connecting to database error

Reply

Join Date: Sep 2005
Posts: 139
Reputation: aarya is an unknown quantity at this point 
Solved Threads: 0
aarya's Avatar
aarya aarya is offline Offline
Junior Poster

connecting to database error

 
0
  #1
Oct 18th, 2005
i m very new to asp. i m trying to learn asp. i m trying to connect to mysql database.
i m using this code
<%
' Open database
Dim Conn, RS
Set Conn = Server.CreateObject("ADODB.Connection")
Conn.Open "Driver={MySql}; Server=localhost; database=db name; uid=name; pwd=pass; option=0;"
Set RS = Conn.Execute("SELECT * From userss")
' display results
While Not RS.EOF
Response.Write RS.Fields("usercode") & "<br>"
RS.MoveNext
Wend
' closing connection
RS.Close
Conn.Close
Set RS = Nothing
Set Conn = Nothing
%>

but i m getting the error as


Error Type:
Microsoft OLE DB Provider for ODBC Drivers (0x80004005)
[Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified
/myweb/a.asp, line 5


i have apache on port 80 on my pc
thats y i m working asp on iis
as localhost:81/myweb/a.asp
is this causing any problem
Reply With Quote Quick reply to this message  
Join Date: Sep 2005
Posts: 139
Reputation: aarya is an unknown quantity at this point 
Solved Threads: 0
aarya's Avatar
aarya aarya is offline Offline
Junior Poster

Re: connecting to database error

 
0
  #2
Oct 19th, 2005
the error was i had no myodbc connection. i downloaded myodbc connector the it worked.
Reply With Quote Quick reply to this message  
Join Date: Mar 2005
Posts: 131
Reputation: william_stam is an unknown quantity at this point 
Solved Threads: 2
william_stam's Avatar
william_stam william_stam is offline Offline
Junior Poster

Re: connecting to database error

 
0
  #3
Nov 15th, 2005
also use option 3. aparently it makes a difference
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC