|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| ||||||||||||||||||||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
Data source name not found and no default driver specified
Hi all,
I'm a beginner of ASP and Database. I've searched through this forum about my issue. It seems that it is like my case. I've got the error message: Microsoft OLE DB Provider for ODBC Drivers (0x80004005) [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified /new/login2.asp, line 20 My ASP script: <% dim name, pass name=Request.form("uname") pass=Request.form("password") set conn=server.CreateObject("ADODB.connection") conn.ConnectionString="provider=Microsoft.jet.OLEDB.4.0;data source=C:\Inetpub\wwwroot\new\dbase.mdb" conn.Open set rs=Server.CreateObject("ADODB.recordset") query="select * from log1 where Password='" & pass & "'" rs.Open query,conn if not rs.EOF then sql_insert="UPDATE log1 SET [Remark] ='Done' WHERE Password='" & pass & "'" Set conn = Server.CreateObject("ADODB.Connection") conn.Open data_source conn.Execute sql_insert response.redirect ("main.asp") else response.Write "<h4> USER NAME & PASSWORD NOT MATCHING </h4>" end if %> Is there any wrong in there? Please help......Thank you so much.... |
|
#2
|
|||
|
|||
|
Try setting the connection string again on the second section.
You have this section that looks like it is running correctly (due to the line number you referenced) Code:
set conn=server.CreateObject("ADODB.connection")
conn.ConnectionString="provider=Microsoft.jet.OLEDB.4.0;data source=C:\Inetpub\wwwroot\new\dbase.mdb"
conn.Open
set rs=Server.CreateObject("ADODB.recordset")
query="select * from log1 where Password='" & pass & "'"
rs.Open query,conn
Code:
sql_insert="UPDATE log1 SET [Remark] ='Done' WHERE Password='" & pass & "'"
Set conn = Server.CreateObject("ADODB.Connection")
conn.Open data_source
conn.Execute sql_insert
Perhaps your connection string gets lost in the "Set conn..." part? Try adding the Connection string line into the section section and see if that works. Alternatively, add a variable at top like Code:
Dim strConnectionString as String strConnectionString="provider=Microsoft.jet.OLEDB.4.0;data source=C:\Inetpub\wwwroot\new\dbase.mdb" Code:
conn.ConnectionString=strConnectionString |
![]() |
| Viewing: Dev Articles Community Forums > Databases > Database Development > Data source name not found and no default driver specified |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|