• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

ASP - having trouble entering into database

oynaz

Platinum Member
Hi guys.

I am making a simple ASP and database based webpage. The users are supposed to be able to enter data into a database. To this end, I have made some forms, and in this asp document I am trying to enter them into my database.
I get this error message:

Technical Information (for support personnel)

* Error Type:
Microsoft OLE DB Provider for ODBC Drivers (0x80004005)
[Microsoft][ODBC Microsoft Access Driver] Operation must use an updateable query.
/drinkoprettelse.asp, line 39

Line 39 reads
Conn.Execute(strSQL)

I can read from the database just fine. Any ideas?

Here is the ASP code:

<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Untitled Document</title>
</head>

<%

'Getting the forms, and replacing ' with "
stralkoholhtml = Request.Form("alkoholhtml")
stralkoholhtml = Replace(strTekst, "'", "''")

strnavnhtml = Request.Form("navnhtml")
strnavnhtml = Replace(strTekst, "'", "''")

strbeskrivelsehtml = Request.Form("beskrivelsehtml")
strbeskrivelsehtml = Replace(strTekst, "'", "''")

stringredienserhtml = Request.Form("ingredienserhtml")
stringredienserhtml = Replace(strTekst, "'", "''")

strtilberedninghtml = Request.Form("tilberedninghtml")
strtilberedninghtml = Replace(strTekst, "'", "''")

streffekthtml = Request.Form("effekthtml")
streffekthtml = Replace(strTekst, "'", "''")

'Database connection
Set Conn = Server.CreateObject("ADODB.Connection")
DSN = "DRIVER={Microsoft Access Driver (*.mdb)}; "
DSN = DSN & "DBQ=" & Server.MapPath("drinksdatabase.mdb")
Conn.Open DSN

'Entering into database

strSQL = "Insert into drinks (alkohol, navn, beskrivelse, ingredienser, tilberedning, effekt) values('1', '" & strnavnhtml& "', '" & strbeskrivelsehtml& "', '" & stringredienserhtml& "', '" & strtilberedninghtml& "', '" & streffekthtml& "')"
Conn.Execute(strSQL)

' Close database connection
Conn.Close
Set Conn = Nothing

%>
<body>
</body>
</html>
 


Does the internet guest account have write rights the mdb files directory? It will need it in order to update the mdb and to create the ldb file.
 
Back
Top