| | |
connecting to database error
Please support our ASP advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
![]() |
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
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
![]() |
Similar Threads
- ASP.NET: Connecting to database (ASP.NET)
- Database error cord identify (Java)
- Error connecting to database (ASP.NET)
- Problems with connections (VB.NET)
- struggling with connecting database to server (ASP.NET)
- help connecting a form to a database.. error message (ASP.NET)
Other Threads in the ASP Forum
- Previous Thread: How to acess data from database and display it form text in formatted way
- Next Thread: Trusted connection in ASP with db
| Thread Tools | Search this Thread |
archive asp asp.net aspandmssqlserver2005 aspandmssqlserver2005connection aspconnection calendar changeable connection current database databaseconnection diagnostics dreamweaver excel fso html iis microsoft msmsql mssql2005 mssqlserver2005 mssqlserver2005andasp mssqlserverandasp opentextfile record searchbox selectoption server single specfic sqlserver sqlserverconnection toolkit web webserver windows7





