FIXED! ***THANK NUKE FARMER!!***

Adul

Elite Member
Oct 9, 1999
32,999
44
91
danny.tangtam.com
I get this error

Error Type:
Microsoft OLE DB Provider for ODBC Drivers (0x80004005)
[Microsoft][ODBC Microsoft Access Driver] Operation must use an updateable query.

I am trying to input data into a database from a webased form. What am I doing wrong?

here is my asp code

<%@LANGUAGE=&quot;VBSCRIPT&quot;%>
<%Response.Buffer=true%>
<%
Dim conn,rs,strsql,surveyno,deptno,position
set conn = server.CreateObject(&quot;ADODB.Connection&quot;)
conn.Open &quot;DSN=survey;uid=user;pwd=2000&quot;

Set cmd = Server.CreateObject(&quot;ADODB.Command&quot;)
Set cmd.ActiveConnection = conn

deptno = Request.Form(&quot;Dept&quot;)
position = Request.Form(&quot;radiobutton&quot;)

strSQL = &quot;INSERT INTO completed_surv (dept,emp_ID) &quot;
strSQL = strSQL &amp; &quot;VALUES (&quot; &amp; deptno
strSQL = strSQL &amp; &quot;,'&quot; &amp; position &amp; &quot;')&quot;

Set rs = conn.Execute(strSQL)
Set rs = nothing

'close the connection
conn.close
set conn = nothing

%>
 

Engine

Senior member
Oct 11, 1999
519
0
0
Shoot... it's been a while since I did ASP, but I do see one thing right off the bat. You're trying to put the results of an insert statement into a recordset. Recordsets only work with SELECTS (or stored procs that return resultsets), I think.

There might also be a parameter you have to set on the Command object to tell it not to be read only. I'll try to look it up somewhere real quick.

EDIT: You may have to set the CommandType property of the Command object to adCmdText, but I'm not sure.
 

nukefarmer

Senior member
May 7, 2000
351
0
0
i know next to nothing about ASP but i'll try anyway :)
i think the insert query doesn't return a resultset, so you might have to use conn.Execute(strSQL) instead of Set rs = conn.Execute(strSQL)