Click to See Complete Forum and Search --> : ASP query help


mattastic
08-27-2008, 08:26 AM
Hi guys,

I haven't used asp for a very long time, but now I need to setup a basic form submitting to a Db. I've got access to the server that hosts the access Db,

My code is below what connects to the DB, but is doesn't work.

I keep getting this error:

Microsoft OLE DB Provider for ODBC Drivers error '80004005'

[Microsoft][ODBC Microsoft Access Driver]General error Unable to open registry key 'Temporary (volatile) Jet DSN for process 0x126c Thread 0x1644 DBC 0x8bcae0c Jet'.

/index/survey.asp, line 99

Can anyone please help?

Thankyou






else
' if the user did input a choice on the vote/ballot
' check to see if their ip address is already in the db
accessdb="digerati"
cn="driver={Microsoft Access Driver (*.mdb)};"
cn=cn & "dbq=" & server.mappath(accessdb)
set rs = server.createobject("ADODB.Recordset")
sql = "select userip from survey where userip ='" & u_ip & "'"

rs.Open sql, cn
if rs.eof then
' if the user has not voted previously indicate it
been_here_before="No"
end if
rs.close

if been_here_before = "No" then
' Since the user has not voted previously their input
' their vote will be added to the db

sql = "insert into survey(ip, selection" & u_input &") "
sql = sql & "values ('" & u_ip & "',1)"
rs.Open sql, cn
end if

Kuriyama
08-29-2008, 08:53 AM
Few things.

1.) Are you sure that you are looking in the correct directory with sever.mapPath. Try server.MapPath("." & "whatever your directory is"), or server.MapPath("/" & "blah blah blah)

2.) Does this database have a username and password on it?

3.) Are you sure the driver is correct?

Bullschmidt
09-07-2008, 05:32 PM
And I've heard that a Microsoft Jet driver is supposed to be better than using a Microsoft Access driver for an Access database on the Web and here is an example:

OLE DB Provider for Microsoft Jet
http://www.carlprothman.net/Default.aspx?tabid=87#OLEDBProviderForMicrosoftJet