access_asp thread: couidn't unsert a row ,help plz
Message #1 by "Yasmine Osama" <start_again_@h...> on Wed, 06 Feb 2002 20:17:11 +0200
|
|
am using O/S xp , whenever i want to insert row in access file error msg
appears saying( operation must use an updatable query)
but when i try this file on another computer using 2000 as O/S it works
can i know why ?
and here is my code
<html>
<%
dim fn,ln,ad,c,em,ph,mb,str
fn=request.form("b1")
ln=request.form("b2")
ad=request.form("b3")
c=request.form("b4")
em=request.form("b5")
ph=request.form("b6")
mb=request.form("b7")
set mydb1=server.createobject("adodb.connection")
mydb1.open("car")
str="insert into buyer_info (first_name, last_name, address, city ,
home_phone , mobile, email) values(' "& fn &" ',' " & ln &" ',' " & ad &"
',' " & c &" ',' "& em &" ',' "& ph & " ',' " & mb &" ')"
mydb1.execute(str)
response.write("<h1>Record Added Successfully</h1>")
%>
</html>
_________________________________________________________________
Send and receive Hotmail on your mobile device: http://mobile.msn.com
Message #2 by "Ken Schaefer" <ken@a...> on Thu, 7 Feb 2002 10:28:56 +1100
|
|
This is a multi-part message in MIME format.
------=_NextPart_000_0102_01C1AFC2.3F4CD280
Content-Type: text/plain;
charset="Windows-1252"
Content-Transfer-Encoding: quoted-printable
Please do this:
str=3D"insert into buyer_info (first_name, last_name, address, city ,
home_phone , mobile, email) values(' "& fn &" ',' " & ln &" ',' " & ad
&"
',' " & c &" ',' "& em &" ',' "& ph & " ',' " & mb &" ')"
Response.Write(str)
Response.End
mydb1.execute(str)
response.write("<h1>Record Added Successfully</h1>")
(Your code is in blue, the code I added is in red). Please post the
output to the list.
Secondly, please post the *error* message you are getting (the exact
error message, and the error number. Please don't make us *guess* what
is wrong.
Cheers
Ken
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
From: "Yasmine Osama" <start_again_@h...>
Subject: [access_asp] couidn't unsert a row ,help plz
:
:
: am using O/S xp , whenever i want to insert row in access file error
msg
: appears saying( operation must use an updatable query)
: but when i try this file on another computer using 2000 as O/S it
works
: can i know why ?
: and here is my code
: <html>
: <%
: dim fn,ln,ad,c,em,ph,mb,str
: fn=3Drequest.form("b1")
: ln=3Drequest.form("b2")
: ad=3Drequest.form("b3")
: c=3Drequest.form("b4")
: em=3Drequest.form("b5")
: ph=3Drequest.form("b6")
: mb=3Drequest.form("b7")
:
:
: set mydb1=3Dserver.createobject("adodb.connection")
: mydb1.open("car")
: str=3D"insert into buyer_info (first_name, last_name, address, city ,
: home_phone , mobile, email) values(' "& fn &" ',' " & ln &" ',' " &
ad &"
: ',' " & c &" ',' "& em &" ',' "& ph & " ',' " & mb &" ')"
: mydb1.execute(str)
: response.write("<h1>Record Added Successfully</h1>")
:
: %>
: </html>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Message #3 by "Ken Schaefer" <ken@a...> on Thu, 7 Feb 2002 10:29:53 +1100
|
|
In addition, you should have a </body> tag before the </html> tag.
http://validator.w3.org is a good resource for validating the HTML of your
webpages.
Cheers
Ken
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
From: "Yasmine Osama" <start_again_@h...>
Subject: [access_asp] couidn't unsert a row ,help plz
: am using O/S xp , whenever i want to insert row in access file error msg
: appears saying( operation must use an updatable query)
: but when i try this file on another computer using 2000 as O/S it works
: can i know why ?
: and here is my code
: <html>
: <%
: dim fn,ln,ad,c,em,ph,mb,str
: fn=request.form("b1")
: ln=request.form("b2")
: ad=request.form("b3")
: c=request.form("b4")
: em=request.form("b5")
: ph=request.form("b6")
: mb=request.form("b7")
:
:
: set mydb1=server.createobject("adodb.connection")
: mydb1.open("car")
: str="insert into buyer_info (first_name, last_name, address, city ,
: home_phone , mobile, email) values(' "& fn &" ',' " & ln &" ',' " & ad &"
: ',' " & c &" ',' "& em &" ',' "& ph & " ',' " & mb &" ')"
: mydb1.execute(str)
: response.write("<h1>Record Added Successfully</h1>")
:
: %>
: </html>
Message #4 by "Charles Mabbott" <aa8vs@m...> on Wed, 6 Feb 2002 18:54:51 -0500
|
|
------=_NextPart_001_0000_01C1AF3F.C1C0E810
Content-Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
Yasmine,
If you have trouble with the posting, e-mail me and I will attach.
This worked for me;
<BODY>
<%
Dim objRS, objComm, intNoOfRecords, strfname, strlname, strcall, strclass
, strdate
strfname =3D Request.Form("sfn") ' first name
strlname =3D request.form("sln") ' last name
strcall =3D UCase(request.form("scl") ) ' FCC call sign
strclass =3D request.form("drop") ' license class
strdate =3D request.form("sRn") ' date if provided
if ( len(strdate) < 1) then ' no date passed fill in default
datarr(0) =3D "4/"
datarr(1) =3D "1/"
datarr(2) =3D year(date)+1
strdate =3D join(datarr,"")
end if
response.write "<p>Insert " & strfname & " " & strlname & "<br>"
response.write "Call sign=3D " & strcall & " License=3D " & strclass & "<
br>"
response.write "Renewal date: " & strdate & "<br>"
Set objComm =3D Server.CreateObject("ADODB.Command")
objComm.ActiveConnection =3D strConnect
objComm.ActiveConnection =3D strConnect
objComm.CommandText =3D "INSERT INTO Members(Fname, lname, callid, class,
renew) VALUES ( '" & strfname & "', '" & strlname & "' , '" & strcall &
"', ' " & strclass & "', '" & strdate & "')"
objComm.CommandType =3D adCmdText
objComm.Execute intNoOfRecords
Response.Write "The INSERT command has been executed; " & _
" " & intNoOfRecords & " member has been added <HR>"
Set objComm =3D Nothing
%>
----- Original Message -----
From: Yasmine Osama
Sent: Wednesday, February 06, 2002 1:24 PM
To: Access ASP
Subject: [access_asp] couidn't unsert a row ,help plz
am using O/S xp , whenever i want to insert row in access file error msg
appears saying( operation must use an updatable query)
but when i try this file on another computer using 2000 as O/S it works
can i know why ?
and here is my code
<html>
<%
dim fn,ln,ad,c,em,ph,mb,str
fn=3Drequest.form("b1")
ln=3Drequest.form("b2")
ad=3Drequest.form("b3")
c=3Drequest.form("b4")
em=3Drequest.form("b5")
ph=3Drequest.form("b6")
mb=3Drequest.form("b7")
set mydb1=3Dserver.createobject("adodb.connection")
mydb1.open("car")
str=3D"insert into buyer_info (first_name, last_name, address, city ,
home_phone , mobile, email) values(' "& fn &" ',' " & ln &" ',' " & ad &
"
',' " & c &" ',' "& em &" ',' "& ph & " ',' " & mb &" ')"
mydb1.execute(str)
response.write("<h1>Record Added Successfully</h1>")
%>
</html>
_________________________________________________________________
Send and receive Hotmail on your mobile device: http://mobile.msn.com
to unsubscribe send a blank email to leave-access_asp-646257P@p...
m.Get more from the Web. FREE MSN Explorer download : http://explorer.ms
n.com
Message #5 by btodd@a... on Thu, 7 Feb 2002 18:39:24
|
|
When I've gotten this in the past (with the database at a remote server),
I had to have the server administrator set write permissions for the
folder the database was in.
You say that on a different computer, all works fine - does the different
computer have a different copy of the database?
|