|
 |
access_asp thread: INSERT Message - Operation must use an updateable query.
Message #1 by "Bob Conner" <bobconner1@n...> on Fri, 25 Oct 2002 16:55:02
|
|
When I attempt to do an INSERT using the code that follows I get the
following error:
?Error Type
Microsoft JET Database Engine (0x80004005)
Operation must use an updateable query.
/bbc/Confirmation.asp line 35
<%OPTION EXPLICIT%>
<HTML>
<HEAD>
<TITLE>INSERT NEW RECORD TEST</TITLE>
</HEAD>
<BODY>
<%
'Declare Variables
Dim strConnect
Dim objCommand
Dim objRS
'Assign Values to Variables
strConnect ="Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=C:\inetpub\wwwroot\bbc\data\ClassProject.mdb;" & _
"Persist Security Info=False"
Set objCommand = Server.CreateObject("ADODB.Command")
objCommand.ActiveConnection = strConnect
'Insert the word 'Bob' into a field called TestField (the only
field in the table) Into the tblTest Table
objCommand.CommandText = "INSERT INTO tblTest (TestField)
VALUES ('Bob')"
%>
</BODY>
</HTML>
Here is some additional information:
· I have no problems with my SELECT statements.
· The values from the ASP page that directs the user to this one are
being passed.
· I have attached the Microsoft Access Driver to my Database in the
ODBC Data Source Administrator.
· When I purposely misspell the table name I get an error that the
output table cannot be found. Because of this I have eliminated the
possibility that I am not properly connected to the database or that I
have misspelling.
· When I eliminate INTO from the statement I get a syntax error.
Therefore I have eliminated syntax errors.
· When I purposely misspell the field name I still get
the ?Operation must use an updateable query? error. This has led me to
conclude that something is not working once the table is found.
· If I eliminate the query the page will load with no problems and I
can get any request.form values (which have been removed from the above
code for ease in troubleshooting) to display.
· I have never gotten the INSERT statement to work on any of my
pages in this database and this is the first ASP program I have tried to
use the INSERT statement.
· The field in my table is a text field with a field size of 50 and
is the only field in the table.
· I have tried passing both hard coded values and variables and have
gotten the same error message.
Any thoughts would be appreciated. Thank you in advance for your help.
bob
Message #2 by "Larry Woods" <larry@l...> on Fri, 25 Oct 2002 11:12:28 -0700
|
|
Bob,
In my experiences, this error was traced to incorrect permissions
on the database file (Windows 2000).
Larry Woods
> -----Original Message-----
> From: Bob Conner [mailto:bobconner1@n...]
> Sent: Friday, October 25, 2002 4:55 PM
> To: Access ASP
> Subject: [access_asp] INSERT Message - Operation must
> use an updateable
> query.
>
>
> When I attempt to do an INSERT using the code that
> follows I get the
> following error:
>
> ?Error Type
> Microsoft JET Database Engine (0x80004005)
> Operation must use an updateable query.
> /bbc/Confirmation.asp line 35
>
> <%OPTION EXPLICIT%>
>
> <HTML>
>
> <HEAD>
>
> <TITLE>INSERT NEW RECORD TEST</TITLE>
>
> </HEAD>
>
> <BODY>
>
> <%
>
> 'Declare Variables
>
> Dim strConnect
> Dim objCommand
> Dim objRS
>
> 'Assign Values to Variables
>
> strConnect ="Provider=Microsoft.Jet.OLEDB.4.0;" & _
> "Data
> Source=C:\inetpub\wwwroot\bbc\data\ClassProject.mdb;" & _
> "Persist Security Info=False"
>
> Set objCommand
> Server.CreateObject("ADODB.Command")
>
> objCommand.ActiveConnection = strConnect
>
> 'Insert the word 'Bob' into a field called
> TestField (the only
> field in the table) Into the tblTest Table
>
> objCommand.CommandText = "INSERT INTO
> tblTest (TestField)
> VALUES ('Bob')"
>
> %>
>
> </BODY>
>
> </HTML>
>
> Here is some additional information:
>
> · I have no problems with my SELECT statements.
> · The values from the ASP page that directs the
> user to this one are
> being passed.
> · I have attached the Microsoft Access Driver to
> my Database in the
> ODBC Data Source Administrator.
> · When I purposely misspell the table name I get
> an error that the
> output table cannot be found. Because of this I have
> eliminated the
> possibility that I am not properly connected to the
> database or that I
> have misspelling.
> · When I eliminate INTO from the statement I get a
> syntax error.
> Therefore I have eliminated syntax errors.
> · When I purposely misspell the field name I still get
> the ?Operation must use an updateable query? error.
> This has led me to
> conclude that something is not working once the table is found.
> · If I eliminate the query the page will load with
> no problems and I
> can get any request.form values (which have been
> removed from the above
> code for ease in troubleshooting) to display.
> · I have never gotten the INSERT statement to work
> on any of my
> pages in this database and this is the first ASP
> program I have tried to
> use the INSERT statement.
> · The field in my table is a text field with a
> field size of 50 and
> is the only field in the table.
> · I have tried passing both hard coded values and
> variables and have
> gotten the same error message.
>
> Any thoughts would be appreciated. Thank you in
> advance for your help.
>
> bob
>
Message #3 by "Bob Conner" <bobconner1@n...> on Fri, 25 Oct 2002 15:37:12 -0400
|
|
Larry,
You were right!!!!!!! I changed the file permissions on the database file
to "full control" for Everyone and it worked perfectly. Many thanks for
your help and the quick response.
bobc
----- Original Message -----
From: "Larry Woods" <larry@l...>
To: "Access ASP" <access_asp@p...>
Sent: Friday, October 25, 2002 2:12 PM
Subject: [access_asp] RE: INSERT Message - Operation must use an updateable
query.
Bob,
In my experiences, this error was traced to incorrect permissions
on the database file (Windows 2000).
Larry Woods
> -----Original Message-----
> From: Bob Conner [mailto:bobconner1@n...]
> Sent: Friday, October 25, 2002 4:55 PM
> To: Access ASP
> Subject: [access_asp] INSERT Message - Operation must
> use an updateable
> query.
>
>
> When I attempt to do an INSERT using the code that
> follows I get the
> following error:
>
> "Error Type
> Microsoft JET Database Engine (0x80004005)
> Operation must use an updateable query.
> /bbc/Confirmation.asp line 35
>
> <%OPTION EXPLICIT%>
>
> <HTML>
>
> <HEAD>
>
> <TITLE>INSERT NEW RECORD TEST</TITLE>
>
> </HEAD>
>
> <BODY>
>
> <%
>
> 'Declare Variables
>
> Dim strConnect
> Dim objCommand
> Dim objRS
>
> 'Assign Values to Variables
>
> strConnect ="Provider=Microsoft.Jet.OLEDB.4.0;" & _
> "Data
> Source=C:\inetpub\wwwroot\bbc\data\ClassProject.mdb;" & _
> "Persist Security Info=False"
>
> Set objCommand
> Server.CreateObject("ADODB.Command")
>
> objCommand.ActiveConnection = strConnect
>
> 'Insert the word 'Bob' into a field called
> TestField (the only
> field in the table) Into the tblTest Table
>
> objCommand.CommandText = "INSERT INTO
> tblTest (TestField)
> VALUES ('Bob')"
>
> %>
>
> </BODY>
>
> </HTML>
>
> Here is some additional information:
>
> · I have no problems with my SELECT statements.
> · The values from the ASP page that directs the
> user to this one are
> being passed.
> · I have attached the Microsoft Access Driver to
> my Database in the
> ODBC Data Source Administrator.
> · When I purposely misspell the table name I get
> an error that the
> output table cannot be found. Because of this I have
> eliminated the
> possibility that I am not properly connected to the
> database or that I
> have misspelling.
> · When I eliminate INTO from the statement I get a
> syntax error.
> Therefore I have eliminated syntax errors.
> · When I purposely misspell the field name I still get
> the "Operation must use an updateable query" error.
> This has led me to
> conclude that something is not working once the table is found.
> · If I eliminate the query the page will load with
> no problems and I
> can get any request.form values (which have been
> removed from the above
> code for ease in troubleshooting) to display.
> · I have never gotten the INSERT statement to work
> on any of my
> pages in this database and this is the first ASP
> program I have tried to
> use the INSERT statement.
> · The field in my table is a text field with a
> field size of 50 and
> is the only field in the table.
> · I have tried passing both hard coded values and
> variables and have
> gotten the same error message.
>
> Any thoughts would be appreciated. Thank you in
> advance for your help.
>
> bob
>
|
|
 |