|
 |
access_asp thread: Operation must use an updateable query
Message #1 by Bob Maarschalkerweerd <BobM@h...> on Fri, 8 Feb 2002 12:02:00 -0500
|
|
I hope one of you can help me sort out this error I'm getting while writing
from my .asp to MSAccess. I have set up ODBC as a system DSN and have the
database in a directory under the WWWROOT folder as HCHADO, the database
name is HCHADO.MDB.
I have a page "Register.htm that is to receive the input and then use POST
to Take_register.asp. The code below is in the Take_register.asp page.
Here are my open statements:
' Create the database object
Set hchadoDB = Server.CreateObject("ADODB.Connection")
hchadoDB.Open "hchado"
I have tried to locate the error on http://support.microsoft.com - odbc but
cannot find a resolution to this error.
I have pulled the error information from my page and received this message:
Error Writing data to the database!
Error Number : -2147467259
Error Source : Microsoft OLE DB Provider for ODBC Drivers
Error Description: [Microsoft][ODBC Microsoft Access Driver] Operation must
use an updateable query.
This is my sql insert statement:
'Write this data into the HCHADO Database.
sqlText = "insert into client"
sqlText = sqlText & " ( firstname,"
sqlText = sqlText & "phone, comments)"
sqlText = sqlText & " values ('"
sqlText = sqlText & p_firstname
sqlText = sqlText & "', '"
sqlText = sqlText & p_phone
sqlText = sqlText & "', '"
sqlText = sqlText & p_comments &"')"
'Response.Write "<BR>______U p d a t e - D a t a b a s e_________ "
hchadoDB.Execute(sqlText)
. . . e t c...
What am I doing wrong?
If you need additional information please let me know and I'll gladly pass
it on.
Regards,
Bob Maarschalkerweerd
-------------------------------------
Heritage Custom Homes
Ph (xxx) xxx-xxxx
Fax (xxx) xxx-xxxx
Cell (xxx) xxx-xxxx
mailto:bobm@h...
Message #2 by "Charles Mabbott" <aa8vs@m...> on Fri, 08 Feb 2002 12:46:48 -0500
|
|
I will take and recomend a page from Ken's book and it works
slick.................
After you set this statement up
a couple of lines later put in
...
...
sqlText = sqlText & p_firstname
> sqlText = sqlText & "', '"
> sqlText = sqlText & p_phone
> sqlText = sqlText & "', '"
> sqlText = sqlText & p_comments &"')"
response.write(sqlText)
response.end
Then see if the statement looks like it is supposed to
> 'Response.Write "<BR>______U p d a t e - D a t a b a s e_________ "
>
hchadoDB.Execute(sqlText)
>. . . e t c...
>
response.write(sqlText)
response.end
>From: Bob Maarschalkerweerd <BobM@h...>
>Reply-To: "Access ASP" <access_asp@p...>
>To: "Access ASP" <access_asp@p...>
>Subject: [access_asp] Operation must use an updateable query
>Date: Fri, 8 Feb 2002 12:02:00 -0500
>
>I hope one of you can help me sort out this error I'm getting while writing
>from my .asp to MSAccess. I have set up ODBC as a system DSN and have the
>database in a directory under the WWWROOT folder as HCHADO, the database
>name is HCHADO.MDB.
>I have a page "Register.htm that is to receive the input and then use POST
>to Take_register.asp. The code below is in the Take_register.asp page.
>Here are my open statements:
>' Create the database object
> Set hchadoDB = Server.CreateObject("ADODB.Connection")
> hchadoDB.Open "hchado"
>I have tried to locate the error on http://support.microsoft.com - odbc but
>cannot find a resolution to this error.
>I have pulled the error information from my page and received this message:
>Error Writing data to the database!
>Error Number : -2147467259
>Error Source : Microsoft OLE DB Provider for ODBC Drivers
>Error Description: [Microsoft][ODBC Microsoft Access Driver] Operation must
>use an updateable query.
>
>This is my sql insert statement:
>'Write this data into the HCHADO Database.
> sqlText = "insert into client"
> sqlText = sqlText & " ( firstname,"
> sqlText = sqlText & "phone, comments)"
> sqlText = sqlText & " values ('"
> sqlText = sqlText & p_firstname
> sqlText = sqlText & "', '"
> sqlText = sqlText & p_phone
> sqlText = sqlText & "', '"
> sqlText = sqlText & p_comments &"')"
> 'Response.Write "<BR>______U p d a t e - D a t a b a s e_________ "
> hchadoDB.Execute(sqlText)
>. . . e t c...
>
>What am I doing wrong?
>
>If you need additional information please let me know and I'll gladly pass
>it on.
>
>Regards,
>Bob Maarschalkerweerd
>-------------------------------------
>Heritage Custom Homes
>Ph (xxx) xxx-xxxx
>Fax (xxx) xxx-xxxx
>Cell (xxx) xxx-xxxx
>mailto:bobm@h...
>
>
_________________________________________________________________
Join the world?s largest e-mail service with MSN Hotmail.
http://www.hotmail.com
Message #3 by Bob Maarschalkerweerd <BobM@h...> on Fri, 8 Feb 2002 13:39:09 -0500
|
|
Hi Charles, Thanks for the response. Yes I actually have that statement in
the code to see that I'm writing and receiving the correct data. Below is
the actual data I display on the screen as a result of the POST operation
and using the Response.Write operation. The data looks good, as dows the
insert statement!:
______U s e r - I n p u t_________
Display user input :
First Name: Bob
Last Name : Maarschalkerweerd
Email : bobm@h...
Office Ph.: (xxx) xxx-xxxx
Cell Ph. : (xxx) xxx-xxxx
Comments : More Please
______E n d - I n p u t_________
______U p d a t e - D a t a b a s e_________
- - - - - - - - - - - - - - - - - - - - - -
Insert the following data into Database :
insert into client ( firstname, initials, lastname, address1, address2,
city, state, zip, email, hphone, ophone, cphone, fphone, comments) values
('Bob', '', 'Maarschalkerweerd', '', '', '', '', '', 'bobm@h...', '',
' (xxx) xxx-xxxx', ' (xxx) xxx-xxxx', '', 'More Please')
______U p d a t e - E n d_________
+++++++++++++++++++++++++++++++++++++++
Error Writing data to the database!
Error Number : -2147467259
Error Source : Microsoft OLE DB Provider for ODBC Drivers
Error Description: [Microsoft][ODBC Microsoft Access Driver] Operation must
use an updateable query.
+++++++++++++++++++++++++++++++++++++++
Regards,
Bob Maarschalkerweerd
-------------------------------------
Ph (xxx) xxx-xxxx
Fax (xxx) xxx-xxxx
Cell (xxx) xxx-xxxx
mailto:bobm@h...
-----Original Message-----
From: Charles Mabbott [mailto:aa8vs@m...]
Sent: Friday, February 08, 2002 12:47 PM
To: Access ASP
Subject: [access_asp] Re: Operation must use an updateable query
I will take and recomend a page from Ken's book and it works
slick.................
After you set this statement up
a couple of lines later put in
...
...
sqlText = sqlText & p_firstname
> sqlText = sqlText & "', '"
> sqlText = sqlText & p_phone
> sqlText = sqlText & "', '"
> sqlText = sqlText & p_comments &"')"
response.write(sqlText)
response.end
Then see if the statement looks like it is supposed to
> 'Response.Write "<BR>______U p d a t e - D a t a b a s e_________ "
>
hchadoDB.Execute(sqlText)
>. . . e t c...
>
response.write(sqlText)
response.end
>From: Bob Maarschalkerweerd <BobM@h...>
>Reply-To: "Access ASP" <access_asp@p...>
>To: "Access ASP" <access_asp@p...>
>Subject: [access_asp] Operation must use an updateable query
>Date: Fri, 8 Feb 2002 12:02:00 -0500
>
>I hope one of you can help me sort out this error I'm getting while writing
>from my .asp to MSAccess. I have set up ODBC as a system DSN and have the
>database in a directory under the WWWROOT folder as HCHADO, the database
>name is HCHADO.MDB.
>I have a page "Register.htm that is to receive the input and then use POST
>to Take_register.asp. The code below is in the Take_register.asp page.
>Here are my open statements:
>' Create the database object
> Set hchadoDB = Server.CreateObject("ADODB.Connection")
> hchadoDB.Open "hchado"
>I have tried to locate the error on http://support.microsoft.com - odbc but
>cannot find a resolution to this error.
>I have pulled the error information from my page and received this message:
>Error Writing data to the database!
>Error Number : -2147467259
>Error Source : Microsoft OLE DB Provider for ODBC Drivers
>Error Description: [Microsoft][ODBC Microsoft Access Driver] Operation must
>use an updateable query.
>
>This is my sql insert statement:
>'Write this data into the HCHADO Database.
> sqlText = "insert into client"
> sqlText = sqlText & " ( firstname,"
> sqlText = sqlText & "phone, comments)"
> sqlText = sqlText & " values ('"
> sqlText = sqlText & p_firstname
> sqlText = sqlText & "', '"
> sqlText = sqlText & p_phone
> sqlText = sqlText & "', '"
> sqlText = sqlText & p_comments &"')"
> 'Response.Write "<BR>______U p d a t e - D a t a b a s e_________ "
> hchadoDB.Execute(sqlText)
>. . . e t c...
>
>What am I doing wrong?
>
>If you need additional information please let me know and I'll gladly pass
>it on.
>
>Regards,
>Bob Maarschalkerweerd
>-------------------------------------
>Heritage Custom Homes
>Ph (xxx) xxx-xxxx
>Fax (xxx) xxx-xxxx
>Cell (xxx) xxx-xxxx
>mailto:bobm@h...
>
>
_________________________________________________________________
Join the world's largest e-mail service with MSN Hotmail.
http://www.hotmail.com
Message #4 by "mAn[s]o0r aD3nWa|a" <mansoor_adenwala@y...> on Sat, 9 Feb 2002 02:02:20 +0500
|
|
This is a multi-part message in MIME format.
------=_NextPart_000_0066_01C1B10D.CEAE38A0
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
hi,
instead of using ADODB.connection
use the ADODB.Command object.
set the active_connection to your DSN
construct your SQL query,
load it in the command_text property.
and then execute the query.
that should solve your problem
mAn[s]o0r T aD3nWaLa
Mujhe yaad tum karte ho
Aksar bhool kar
Main to bhool hi na paai tumhe
Kya yaad karoongi ae bekhabar.
----- Original Message -----
From: Bob Maarschalkerweerd
To: Access ASP
Sent: Friday, February 08, 2002 10:02 PM
Subject: [access_asp] Operation must use an updateable query
I hope one of you can help me sort out this error I'm getting while
writing
from my .asp to MSAccess. I have set up ODBC as a system DSN and have
the
database in a directory under the WWWROOT folder as HCHADO, the
database
name is HCHADO.MDB.
I have a page "Register.htm that is to receive the input and then use
POST
to Take_register.asp. The code below is in the Take_register.asp page.
Here are my open statements:
' Create the database object
Set hchadoDB =3D Server.CreateObject("ADODB.Connection")
hchadoDB.Open "hchado"
I have tried to locate the error on http://support.microsoft.com -
odbc but
cannot find a resolution to this error.
I have pulled the error information from my page and received this
message:
Error Writing data to the database!
Error Number : -2147467259
Error Source : Microsoft OLE DB Provider for ODBC Drivers
Error Description: [Microsoft][ODBC Microsoft Access Driver] Operation
must
use an updateable query.
This is my sql insert statement:
'Write this data into the HCHADO Database.
sqlText =3D "insert into client"
sqlText =3D sqlText & " ( firstname,"
sqlText =3D sqlText & "phone, comments)"
sqlText =3D sqlText & " values ('"
sqlText =3D sqlText & p_firstname
sqlText =3D sqlText & "', '"
sqlText =3D sqlText & p_phone
sqlText =3D sqlText & "', '"
sqlText =3D sqlText & p_comments &"')"
'Response.Write "<BR>______U p d a t e - D a t a b a s e_________ "
hchadoDB.Execute(sqlText)
. . . e t c...
What am I doing wrong?
If you need additional information please let me know and I'll gladly
pass
it on.
Regards,
Bob Maarschalkerweerd
-------------------------------------
Heritage Custom Homes
Ph (xxx) xxx-xxxx
Fax (xxx) xxx-xxxx
Cell (xxx) xxx-xxxx
mailto:bobm@h...
$subst('Email.Unsub').
_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com
Message #5 by Bob Maarschalkerweerd <BobM@h...> on Fri, 8 Feb 2002 17:13:47 -0500
|
|
This message is in MIME format. Since your mail reader does not understand
this format, some or all of this message may not be legible.
------_=_NextPart_001_01C1B0ED.E14DBAF0
Content-Type: text/plain;
charset="iso-8859-1"
Thanks for the response, but I'm still not 100% clear on what you mean. How
different is the change you suggest to these 2 statements?
Set hchadoDB = Server.CreateObject("ADODB.Connection")
hchadoDB.Open "hchado"
It seems that I change the ADODB.Connection to ADODB.Command ?
Would it look something like this??
' Set hchadoDB = Server.CreateObject("ADODB.Command")
' strDbPath = Server.MapPath(".") & "wwwroot\hchado\hchado.mdb"
' ConnectStr = "DRIVER={Microsoft Access Driver (*.mdb)};DBQ=" &
strDbPath
' hchado.Open "client",hchado,adOpenKeyset,adLockOptimistic,adCmdTable
I'm just guessing here!!
Where can I get some more on-line information regarding these ADO commands?
Regards,
Bob Maarschalkerweerd
-------------------------------------
Ph (xxx) xxx-xxxx
Fax (xxx) xxx-xxxx
Cell (xxx) xxx-xxxx
mailto:bobm@h... <mailto:bobm@h...>
-----Original Message-----
From: mAn[s]o0r aD3nWa|a [mailto:mansoor_adenwala@y...]
Sent: Friday, February 08, 2002 4:02 PM
To: Access ASP
Subject: [access_asp] Re: Operation must use an updateable query
hi,
instead of using ADODB.connection
use the ADODB.Command object.
set the active_connection to your DSN
construct your SQL query,
load it in the command_text property.
and then execute the query.
that should solve your problem
mAn[s]o0r T aD3nWaLa
Mujhe yaad tum karte ho
Aksar bhool kar
Main to bhool hi na paai tumhe
Kya yaad karoongi ae bekhabar.
----- Original Message -----
From: Bob <mailto:BobM@h...> Maarschalkerweerd
To: Access ASP <mailto:access_asp@p...>
Sent: Friday, February 08, 2002 10:02 PM
Subject: [access_asp] Operation must use an updateable query
I hope one of you can help me sort out this error I'm getting while writing
from my .asp to MSAccess. I have set up ODBC as a system DSN and have the
database in a directory under the WWWROOT folder as HCHADO, the database
name is HCHADO.MDB.
I have a page "Register.htm that is to receive the input and then use POST
to Take_register.asp. The code below is in the Take_register.asp page.
Here are my open statements:
' Create the database object
Set hchadoDB = Server.CreateObject("ADODB.Connection")
hchadoDB.Open "hchado"
I have tried to locate the error on http://support.microsoft.com
<http://support.microsoft.com> - odbc but
cannot find a resolution to this error.
I have pulled the error information from my page and received this message:
Error Writing data to the database!
Error Number : -2147467259
Error Source : Microsoft OLE DB Provider for ODBC Drivers
Error Description: [Microsoft][ODBC Microsoft Access Driver] Operation must
use an updateable query.
This is my sql insert statement:
'Write this data into the HCHADO Database.
sqlText = "insert into client"
sqlText = sqlText & " ( firstname,"
sqlText = sqlText & "phone, comments)"
sqlText = sqlText & " values ('"
sqlText = sqlText & p_firstname
sqlText = sqlText & "', '"
sqlText = sqlText & p_phone
sqlText = sqlText & "', '"
sqlText = sqlText & p_comments &"')"
'Response.Write "<BR>______U p d a t e - D a t a b a s e_________ "
hchadoDB.Execute(sqlText)
. . . e t c...
What am I doing wrong?
If you need additional information please let me know and I'll gladly pass
it on.
Regards,
Bob Maarschalkerweerd
-------------------------------------
Heritage Custom Homes
Ph (xxx) xxx-xxxx
Fax (xxx) xxx-xxxx
Cell (xxx) xxx-xxxx
mailto:bobm@h... <mailto:bobm@h...>
---
Change your mail options at http://p2p.wrox.com/manager.asp
<http://p2p.wrox.com/manager.asp> or
<mailto:$subst('Email.Unsub')> .
Message #6 by btodd@a... on Sat, 9 Feb 2002 02:18:17
|
|
The most common problems I've run into are:
1) IUSR_MACHINE does not have Write permissions on the database file or
the directory the database is in (Access requires write on both). What
environment are you in (i.e., local machine, shared server, dedicated...)?
If shared (virtual) a quick work-around is to use the cgi-bin directory
which almost always has write permissions set.
2) The database was not opened with the correct MODE for writing. The
default usually works ok, but you can add it explicitly just before your
Open like so to be sure:
hchadoDB.Mode = 3 '3 = adModeReadWrite
hchadoDB.Open
hth,
Bill Todd
PS - there is more info at the Microsoft site:
http://support.microsoft.com/default.aspx?scid=kb;EN-US;q175168
I found that by entering the error message text, 'Operation must use an
updateable query', into www.ixquick.com, my personal favorite search
engine for this kind of question - it's even better than Google!
Message #7 by "mAn[s]o0r aD3nWa|a" <mansoor_adenwala@y...> on Sat, 9 Feb 2002 21:11:50 +0500
|
|
This is a multi-part message in MIME format.
------=_NextPart_000_0097_01C1B1AE.6401A5E0
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
it goes somethin like this,
set hchadoDB =3D Server.createObject("ADODB.Command")
hchadoDB.active_connection =3D "provider=3Dmicrosoft.jet.oledb.4.0; data
source=3DServer.MapPath(".") & "wwwroot\hchado\hchado.mdb"
hchadoDB.command_text =3D sqlString
hchadoDB.execute
just create the sqlString first, then execute it.
hth
mAn[s]o0r T aD3nWaLa
Mujhe yaad tum karte ho
Aksar bhool kar
Main to bhool hi na paai tumhe
Kya yaad karoongi ae bekhabar.
----- Original Message -----
From: Bob Maarschalkerweerd
To: Access ASP
Sent: Saturday, February 09, 2002 3:13 AM
Subject: [access_asp] Re: Operation must use an updateable query
Thanks for the response, but I'm still not 100% clear on what you
mean. How different is the change you suggest to these 2 statements?
Set hchadoDB =3D Server.CreateObject("ADODB.Connection")
hchadoDB.Open "hchado"
It seems that I change the ADODB.Connection to ADODB.Command ?
Would it look something like this??
' Set hchadoDB =3D Server.CreateObject("ADODB.Command")
' strDbPath =3D Server.MapPath(".") & "wwwroot\hchado\hchado.mdb"
' ConnectStr =3D "DRIVER=3D{Microsoft Access Driver
(*.mdb)};DBQ=3D" & strDbPath
' hchado.Open
"client",hchado,adOpenKeyset,adLockOptimistic,adCmdTable
I'm just guessing here!!
Where can I get some more on-line information regarding these ADO
commands?
Regards,
Bob Maarschalkerweerd
-------------------------------------
Ph (xxx) xxx-xxxx
Fax (xxx) xxx-xxxx
Cell (xxx) xxx-xxxx
mailto:bobm@h...
-----Original Message-----
From: mAn[s]o0r aD3nWa|a [mailto:mansoor_adenwala@y...]
Sent: Friday, February 08, 2002 4:02 PM
To: Access ASP
Subject: [access_asp] Re: Operation must use an updateable query
hi,
instead of using ADODB.connection
use the ADODB.Command object.
set the active_connection to your DSN
construct your SQL query,
load it in the command_text property.
and then execute the query.
that should solve your problem
mAn[s]o0r T aD3nWaLa
Mujhe yaad tum karte ho
Aksar bhool kar
Main to bhool hi na paai tumhe
Kya yaad karoongi ae bekhabar.
----- Original Message -----
From: Bob Maarschalkerweerd
To: Access ASP
Sent: Friday, February 08, 2002 10:02 PM
Subject: [access_asp] Operation must use an updateable query
I hope one of you can help me sort out this error I'm getting
while writing
from my .asp to MSAccess. I have set up ODBC as a system DSN and
have the
database in a directory under the WWWROOT folder as HCHADO, the
database
name is HCHADO.MDB.
I have a page "Register.htm that is to receive the input and then
use POST
to Take_register.asp. The code below is in the Take_register.asp
page.
Here are my open statements:
' Create the database object
Set hchadoDB =3D Server.CreateObject("ADODB.Connection")
hchadoDB.Open "hchado"
I have tried to locate the error on http://support.microsoft.com -
odbc but
cannot find a resolution to this error.
I have pulled the error information from my page and received this
message:
Error Writing data to the database!
Error Number : -2147467259
Error Source : Microsoft OLE DB Provider for ODBC Drivers
Error Description: [Microsoft][ODBC Microsoft Access Driver]
Operation must
use an updateable query.
This is my sql insert statement:
'Write this data into the HCHADO Database.
sqlText =3D "insert into client"
sqlText =3D sqlText & " ( firstname,"
sqlText =3D sqlText & "phone, comments)"
sqlText =3D sqlText & " values ('"
sqlText =3D sqlText & p_firstname
sqlText =3D sqlText & "', '"
sqlText =3D sqlText & p_phone
sqlText =3D sqlText & "', '"
sqlText =3D sqlText & p_comments &"')"
'Response.Write "<BR>______U p d a t e - D a t a b a s e_________
"
hchadoDB.Execute(sqlText)
. . . e t c...
What am I doing wrong?
If you need additional information please let me know and I'll
gladly pass
it on.
Regards,
Bob Maarschalkerweerd
-------------------------------------
Heritage Custom Homes
Ph (xxx) xxx-xxxx
Fax (xxx) xxx-xxxx
Cell (xxx) xxx-xxxx
mailto:bobm@h...
$subst('Email.Unsub').
$subst('Email.Unsub').
$subst('Email.Unsub').
_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com
Message #8 by Bob Maarschalkerweerd <BobM@h...> on Mon, 11 Feb 2002 13:23:16 -0500
|
|
Thanks for the update. I am running Win2kPro with PWS, the database is on my
WWWROOT drive. I will move the database to the wwwroot and the homepage
subfolder, and move the database into the cgi-bin directory. I will also try
the MODE=3 and see if that helps. As for the IUSR_MACHINE, I will check what
authorization that has. By default it is "Guests" Group - and I will fix the
directory (cgi-bin) that IUSR_Machine has write access to it.
Thanks
Regards,
Bob Maarschalkerweerd
-------------------------------------
Ph (xxx) xxx-xxxx
Fax (xxx) xxx-xxxx
Cell (xxx) xxx-xxxx
mailto:bobm@h...
-----Original Message-----
From: btodd@a... [mailto:btodd@a...]
Sent: Friday, February 08, 2002 9:18 PM
To: Access ASP
Subject: [access_asp] Re: Operation must use an updateable query
The most common problems I've run into are:
1) IUSR_MACHINE does not have Write permissions on the database file or
the directory the database is in (Access requires write on both). What
environment are you in (i.e., local machine, shared server, dedicated...)?
If shared (virtual) a quick work-around is to use the cgi-bin directory
which almost always has write permissions set.
2) The database was not opened with the correct MODE for writing. The
default usually works ok, but you can add it explicitly just before your
Open like so to be sure:
hchadoDB.Mode = 3 '3 = adModeReadWrite
hchadoDB.Open
hth,
Bill Todd
PS - there is more info at the Microsoft site:
http://support.microsoft.com/default.aspx?scid=kb;EN-US;q175168
I found that by entering the error message text, 'Operation must use an
updateable query', into www.ixquick.com, my personal favorite search
engine for this kind of question - it's even better than Google!
|
|
 |