Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Operation must use an updateable query??

Status
Not open for further replies.

jasek78

Programmer
Nov 5, 2001
298
US
I get this error when I submit data to be put into an Access2000 database.

Does anyone know what that means and what I can do about it???

Thanks for your help

jason
 
jason,

When you ask for help, please try to give as much information as possible. Your question is too broad and doesn't give us a clue as to what you are doing.

Tell us what your problem is, what types of errors, any error messages or information that will give us some idea of what's going on.

Thanks,
fengshui_1998
 
As follows is the connection string (I'm using a direct path for now to simplify some things).

I'm using Dreamweaver UltraDev to create a website to display and administer a database of 1 table ('Projects')

The error comes up on the "MM_insertCmd.Execute" line -

"Operation must use an updateable query"

Set MM_insertCmd = Server.CreateObject("ADODB.Command")
MM_insertCmd.ActiveConnection= "Provider=Microsoft.Jet.OLEDB.4.0;
Data Source=C:\Inetpub\Persist Security Info=False"

MM_insertCmd.CommandText = MM_insertStr
MM_insertCmd.Execute

I'm trying to find out what is going on, so I was asking if anyone knew what the difference is between "non-updateable" and "updateable" queries. How would I declare/call an 'updateable query' ?

Thanks again for your help.

jason
 
Well, I didn't, but that wasn't the solution. I set the write permission, and the same error comes up.
 
jason,

Next step, what does your update line look like and are you using any cursors?


fengshui_1998
 
hmm... I'm just gonna post my code here. Take a look and comment. As I said before, this is VBScript/ASP code that is generated by Dreamweaver UltraDev (Macromedia). I've been doing VB the past few years, and I'm trying to learn ASP. Some of the language is different.

Jason

<%@LANGUAGE=&quot;VBSCRIPT&quot;%><%

' *** Insert Record: construct a sql insert statement and execute it

MM_editAction = CStr(Request(&quot;URL&quot;))

If (Request.QueryString <> &quot;&quot;) Then
MM_editAction = MM_editAction & &quot;?&quot; & Request.QueryString
End If

If (CStr(Request(&quot;MM_insert&quot;)) <> &quot;&quot;) Then

MM_tableName = &quot;Projects&quot;
MM_fields = &quot;ProjectID,ProjectID,',none,'',Name,Name,',none,'',Updated,Updated,#,none,NULL,Status,Status,',none,'',Overall,Overall,none,none,NULL,Manager,ProjectManager,',none,''&quot;
MM_redirectPage = &quot;/index.asp&quot;

' create the insert sql statement
MM_tableValues = &quot;&quot;
MM_dbValues = &quot;&quot;
MM_fieldsArray = Split(MM_fields, &quot;,&quot;)

For i = LBound(MM_fieldsArray) To UBound(MM_fieldsArray) Step 5
FormVal = CStr(Request.Form(MM_fieldsArray(i)))
Delim = MM_fieldsArray(i+2)

If (Delim = &quot;none&quot;) Then Delim = &quot;&quot;
AltVal = MM_fieldsArray(i+3)

If (AltVal = &quot;none&quot;) Then AltVal = &quot;&quot;
EmptyVal = MM_fieldsArray(i+4)

If (EmptyVal = &quot;none&quot;) Then EmptyVal = &quot;&quot;

If (FormVal = &quot;&quot;) Then
FormVal = EmptyVal
Else
If (AltVal <> &quot;&quot;) Then
FormVal = AltVal
ElseIf (Delim = &quot;'&quot;) Then ' escape quotes
FormVal = &quot;'&quot; & Replace(FormVal,&quot;'&quot;,&quot;''&quot;) & &quot;'&quot;
Else
FormVal = Delim + FormVal + Delim
End If
End If

If (i <> LBound(MM_fieldsArray)) Then
MM_tableValues = MM_tableValues & &quot;,&quot;
MM_dbValues = MM_dbValues & &quot;,&quot;
End if

MM_tableValues = MM_tableValues & MM_fieldsArray(i+1)
MM_dbValues = MM_dbValues & FormVal
Next
MM_insertStr = &quot;insert into &quot; & MM_tableName & &quot; (&quot; & MM_tableValues & &quot;) values (&quot; & MM_dbValues & &quot;)&quot;

' finish the sql and execute it
'Here is the insert statement -- See above procedure for 'value of MM_insertStr

'********************************************************
'********************************************************

Set MM_insertCmd = Server.CreateObject(&quot;ADODB.Command&quot;)
MM_insertCmd.ActiveConnection = &quot;Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Inetpub\ Security Info=False&quot;
MM_insertCmd.CommandText = MM_insertStr
MM_insertCmd.Execute

' redirect with URL parameters
'If (MM_redirectPage = &quot;&quot;) Then
' MM_redirectPage = CStr(Request(&quot;URL&quot;))
'End If

'If (InStr(1, MM_redirectPage, &quot;?&quot;, vbTextCompare) = 0 And (Request.QueryString <> &quot;&quot;)) Then
' MM_redirectPage = MM_redirectPage & &quot;?&quot; & Request.QueryString
'End If

Call Response.Redirect(MM_redirectPage)
End If
%>
<%
set Recordset1 = Server.CreateObject(&quot;ADODB.Recordset&quot;)
Recordset1.ActiveConnection = &quot;Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Inetpub\ Security Info=False&quot;
Recordset1.Source = &quot;SELECT ProjectID, Name, Updated, Status, Overall, ProjectManager FROM Projects ORDER BY ProjectID ASC&quot;
Recordset1.CursorType = 0
Recordset1.CursorLocation = 2
Recordset1.LockType = 3
Recordset1.Open
Recordset1_numRows = 0
%>
<%
Dim Repeat1__numRows
Dim Repeat1__index
Repeat1__numRows = -1
Repeat1__index = 0
Recordset1_numRows = Recordset1_numRows + Repeat1__numRows
%>
<html>
<head>
<title>Innovativa, LLC - Project Status</title>
<meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=iso-8859-1&quot;>
</head>
<body bgcolor=&quot;#FFFFFF&quot;>
<form name=&quot;frmRecordset&quot; method=&quot;post&quot; action=&quot;<%=MM_editAction%>&quot;>
<table border=&quot;1&quot; name=&quot;Project Status&quot;>
<tr>
<td width=&quot;140&quot;>Project ID</td>
<td width=&quot;152&quot;>
<input type=&quot;text&quot; name=&quot;ProjectID&quot;>
</td>
<td width=&quot;369&quot;>Project ID #</td>
</tr>
<tr>
<td width=&quot;140&quot;>Project Name </td>
<td width=&quot;152&quot;>
<input type=&quot;text&quot; name=&quot;Name&quot;>
</td>
<td width=&quot;369&quot;>Full Name of Project</td>
<input type=&quot;hidden&quot; name=&quot;MM_insert&quot; value=&quot;true&quot;>
</tr>
<tr>
<td width=&quot;140&quot;>Updated</td>
<td width=&quot;152&quot;>
<input type=&quot;text&quot; name=&quot;Updated&quot;>
</td>
<td width=&quot;369&quot;>Date of Last Update</td>
</tr>
<tr>
<td width=&quot;140&quot;>Status </td>
<td width=&quot;152&quot;>
<input type=&quot;text&quot; name=&quot;Status&quot;>
</td>
<td width=&quot;369&quot;>General Status of Project (Not Started, Open, Completed)</td>
</tr>
<tr>
<td width=&quot;140&quot;>Overall</td>
<td width=&quot;152&quot;>
<input type=&quot;text&quot; name=&quot;Overall&quot;>
</td>
<td width=&quot;369&quot;>% Complete (0-100, just the number)</td>
</tr>
<tr>
<td width=&quot;140&quot;>ProjectManager </td>
<td width=&quot;152&quot;>
<input type=&quot;text&quot; name=&quot;Manager&quot;>
</td>
<td width=&quot;369&quot;>Innovativa Project Manager</td>
</tr>
<tr>
<td width=&quot;140&quot;>&nbsp;</td>
<td width=&quot;152&quot;>
<input type=&quot;submit&quot; name=&quot;Submit&quot; value=&quot;Submit&quot;>
</td>
<td width=&quot;369&quot;>&nbsp;</td>
</tr>
</table>
</form>
<p>&nbsp;</p>
</body>
</html>
 

jason,

You need to call out the ADOVBS.INC file which includes constants for ADO. Also try using:

MM_insertCmd.Execute( , , adCmdTable)


fengshui_1998

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top