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 derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Unspecified error

Status
Not open for further replies.

KeystoneBlues

Programmer
Joined
Jun 14, 2004
Messages
9
Location
US
Well, I have no clues on how to look this one up..

Provider error '80004005'

Unspecified error

/ASP BETA/DeleteCC.asp, line 12



Simply trying to delete a record from a MDB database file. I have a server that is Windows driven. I think it's IIS but not positive. I'm thinking this has somethinking to do with the way my server is being opened. I know that there is a way to open the server in read write mode.
Does anyone think that is my problem? If so how would I insert that in the code? I'm guessing something like

<%
Dim Conn, Rs, sql
Set Conn = Server.CreateObject("ADODB.Connection")
conn.mode = 3 ' adModeReadWrite
Set Rs = Server.CreateObject("ADODB.Recordset")
Conn.Open "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" & Server.MapPath("secureorderform.mdb")
sql= "SELECT * FROM Results;"
Rs.Open sql, Conn




All my code is below. The link is at
<%
Dim ID
ID = Request.Form("ID")
if ID="" then
Response.Write "You did not select a name to delete!"
Else
Dim Conn
Dim Rs
Dim sql
Set Conn = Server.CreateObject("ADODB.Connection")
Set Rs = Server.CreateObject("ADODB.Recordset")
Conn.Open "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" & Server.MapPath("secureorderform.mdb")
sql= "Delete * FROM Results WHERE ID='" & ID & "'"
Rs.Open sql, Conn
Conn.Close
Set Conn = Nothing
Response.Write "Successfully Deleted"
End If
%>





displaying with: DeleteRecord.asp
Select name to delete.
<%
Dim Conn, Rs, sql
Set Conn = Server.CreateObject("ADODB.Connection")
Set Rs = Server.CreateObject("ADODB.Recordset")
Conn.Open "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" & Server.MapPath("secureorderform.mdb")
sql= "SELECT * FROM Results;"
Rs.Open sql, Conn
Response.Write "<FORM name='Delete' method='post' action='DeleteCC.asp'>"
Response.Write "<table border=1 cellspacing=0>"
Response.Write "<tr>"&"<td colspan='3' align='center'>"&"Select a record to delete and click delete"&"</td>"&"</tr>"
Response.Write "<tr>"&"<th align='center' colspan='2'>"&"Customer First Name"&"</th>"&"<th align='center'>"&"Customer Last Name"&"</th>"&"</tr>"
Do While not Rs.EOF
Response.Write ("<tr>")
Response.Write ("<td>"&"<input type='radio' name=ID value="&Rs("ID")&">"&"</td>")
Response.Write ("<td>"&Rs("CUSTFIRSTNAME")&"</td>")
Response.Write ("<td>"&Rs("CUSTLASTNAME")&"</td>")
Response.Write ("</tr>")
Rs.MoveNext
Loop
Response.Write("<tr>"&"<td colspan='3' align='center'>"&"<input type ='submit' name='submit' value='Delete' onClick='return validate();'>"&"</td>"&"</tr>")
Response.Write "</table>"
Response.Write "</form>"
Rs.Close
Set Rs = Nothing
Set Conn = Nothing
%>
 
This always works for me. Try handling your connection this way.

Code:
dim cn
dim rs

set cn = Server.Createobject("ADODB.Connection")
set rs = Server.Createobject("ADODB.Recordset")

With cn
    .Provider = "Microsoft.Jet.OLEDB.4.0"
    .Connectionstring = "Path to Microsoft Database"
    .open
end with

rs.open "Delete * FROM Results WHERE ID='" & ID & "'",cn,3,3

DSN causes more this kind of problem a lot. Much easier if you go to OLEDB connection. Also replace the connection string with the path to the database.

Let me know

Cassidy
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top