Karl Blessing
Programmer
Code:
-2147467259
[Microsoft][ODBC Microsoft Access Driver] Operation must use an updateable query.
that is the error I get when I Try to add an entry to a database on my have on website.
I am using a DSN-less connection
"DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=D:\
I even moved the mdb to a folder which I Was absolutly sure I had write permision to.
this is the sniplet of code.
Code:
on error resume next
Set Conn = Server.CreateObject("ADODB.Connection")
Conn.Mode = 3
Conn.Open "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=D:\[URL unfurl="true"]WWWRoot\kb244com\www\_private\database\SiteDb.mdb;",[/URL] "", ""
InsertStr = "Insert into QA (Asker, Question, DateInfo, Email, Answer, Extra) values ('"
InsertStr = InsertStr & Request.Form("Asker") & "','" & Request.Form("Question") & "','" & Date() & "','" & Request.Form("Email") & "', '', '')"
InsertStr = replace(InsertStr, vbcrlf, "<br>")
Conn.Execute InsertStr
if err.number <> 0 then
Response.Write "<center><font color=red>An error has occured during your submission</font></center><br>" & vbcrlf
Response.Write err.number & "<br>" & vbcrlf
Response.Write err.description & "<br>" & vbcrlf
Response.Write "Please contact kb244 with this information at <a href=""admin@kb244.com"">admin@kb244.com</a>"
else
Response.Write "<center>Question sumited without a problem</center>"
end if
if not Conn is nothing then Conn.Close
in the Database
the Table QA
consist of
Code:
QAID - AutoNumber
Asker - Text
Question - Memo
Answer - Memo (with can be zero length turned on)
Date - Text
Extra - Text (with can be zero length turned on)
Email - Text
I know the path is correct, because I can read from the database in the same manner, and using '3' also has Read/Write turned on.
But cant figure out why I Cant get it to add a record.
this is an example of the Query string (which I had Response.write to the screen for debugging)
Code:
<!-- Insert into QA (Asker, Question, DateInfo, Email, Answer, Extra) values ('Karl','This is my question','4/10/2001','test@test.com', '', '') -->