PDA

View Full Version : error when connecting to db


Mhtml
09-24-2002, 02:05 AM
Error Type:
Microsoft OLE DB Provider for ODBC Drivers (0x80004005)
[Microsoft][ODBC Microsoft Access Driver]General error Unable to open registry key 'Temporary (volatile) Jet DSN for process 0x680 Thread 0x6e4 DBC 0x681c024 Jet'.
/projectodyssey/linkdelete.asp, line 10

here is my code:

<%
dim Lname, Lurl, Ldesc
Lname = Request.Form("linkname")
Lurl = Request.Form("linkurl")
Ldesc = Request.Form("Linkdesc")
Lid = "http://" & Request.Form("linknumber")
'This is the code used to make a connection to our database
Set ConnSQL = Server.CreateObject("ADODB.Connection")
path = Server.MapPath("db/odyssey.mdb")
ConnSQL.Open "Driver={Microsoft Access Driver (*.mdb)}; DBQ=" & path

sqlDelete = "DELETE FROM Links WHERE LinkUrl = '"&Lid&"' "
ConnSql.Execute(sqlDelete)
%>

<%
ConnSQL.Close
Set ConnSQL = nothing
Set RS = nothing
%>

<%response.Redirect("links.asp")%>

It was working before, and my link add script (http://24.226.62.28/projectodyssey/links.asp) works on the same conn string and is working fine..

glenngv
09-24-2002, 02:56 AM
try this:

ConnSQL.Open "Driver={Microsoft Access Driver (*.mdb)}; DBQ=" & path & ";"


if that still doesn't work, then try this:

ConnSQL.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & path & ";"

Mhtml
09-24-2002, 03:18 AM
once again you've saved the day glenngv, thanks.

by the way I used :
ConnSQL.Open "Driver={Microsoft Access Driver (*.mdb)}; DBQ=" & path & ";"

Mhtml
09-24-2002, 03:45 AM
Ok, new problem different file.
I'm getting an error which says must be an updateable query on line 18.

<%
'You are here if your session condition is right
'STATS COUNTER BY PROJECT ODYSSEY
dim IP, Browser, Referer, DoCount, Unique, Standard
IP = Request.ServerVariables("REMOTE_ADDR")
Browser = Request.ServerVariables("HTTP_USER_AGENT")
Referer = Request.ServerVariables("HTTP_REFERER")

'This is the code used to make a connection to our database
Set ConnSQL = Server.CreateObject("ADODB.Connection")
path = Server.MapPath("db/odysseystats.mdb")
ConnSQL.Open "Driver={Microsoft Access Driver (*.mdb)}; DBQ=" & path
Standard = "INSERT INTO Counter (IP,Browser,Referer,Day,Month,Year) VALUES ('"&IP&"','"&Browser&"','"&Referer&"','"&Day(now)&"','"&month(now)&"','"&year(now)&"')"
Unique = "INSERT INTO UniqueCounter (IP,Browser,Referer,Day,Month,Year) VALUES ('"&IP&"','"&Browser&"','"&Referer&"','"&Day(now)&"','"&month(now)&"','"&year(now)&"')"
if Request.Cookies("unique") = "no" then
ConnSql.Execute(Standard)
else
ConnSql.Execute(Unique)
ConnSql.Execute(Standard)
end if
Session("counted") = "true"
Response.Cookies("unique") = "no"
%>

<%
ConnSQL.Close
Set ConnSQL = nothing
Set RS = nothing
%>

glenngv
09-24-2002, 04:25 AM
read this FAQ http://www.aspfaqs.com/aspfaqs/ShowFAQ.asp?FAQID=107

Mhtml
09-24-2002, 05:23 AM
hmm...how weird, I just read that bit where the person just re-uploaded the db and it worked... I just did the same thing an presto...oh well, at least it works now.:)