View Single Post
  #1 (permalink)  
Old June 3rd, 2004, 02:25 AM
knight knight is offline
Authorized User
 
Join Date: Feb 2004
Location: Karachi, , Pakistan.
Posts: 81
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to knight
Default insert into not worked

i write the following code



<%if session("granted") = false then
        response.redirect("unauth.htm")
else
'on error resume next
dim rs1,rs2
code=request.Form("code")
rname=request.Form("name")
desc=request.Form("desc")
s1=request.Form("size[0]")
s2=request.Form("size[1]")
s3=request.Form("size[2]")
s4=request.Form("size[3]")
s5=request.Form("size[4]")
s6=request.Form("size[5]")
s7=request.Form("size[6]")
s8=request.Form("size[7]")
price=request.Form("price")
karat=request.Form("karat")
opqty=request.Form("opqty")

set rs1 = server.CreateObject("Adodb.Recordset")
rs1.open ("Select * from tblrings where name='"&ring_name&"'"), conn,1,3
if rs1.eof<>true and rs1.bof<>true then
response.Redirect("add_ring.asp?check=1")
rs1.close
set rs1=nothing

else

'set rs2 = server.CreateObject("Adodb.Recordset")
dim objCmd,intaffectedRec
Set objCmd = Server.CreateObject ("ADODB.Command")

objCmd.ActiveConnection = conn
objCmd.CommandText = "insert into tblRings values('" & ring_code & "', '" & ring_name & "', '" & desc & "'"
objCmd.CommandType = adCmdText
objCmd.Execute intaffectedRec
Response.Write("Number of Records affceted: & intaffectedRec & ")
Set objCmd = Nothing
'response.write rsSQL
response.Redirect("saveimage.asp")
'response.Redirect("add_product.asp?check=2")
end if
conn.close
end if%>

--------------------------
error is shown

Error Type:
Microsoft JET Database Engine (0x80040E14)
Syntax error in INSERT INTO statement.
/jewler/admin/save_ring.asp, line 39


Browser Type:
Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0)

Page:
POST 79 bytes to /jewler/admin/save_ring.asp

POST Data:
ringcode=ssdsds&ringname=sdddds&desc=sdsddsdsds&pr ice=&karat=&opqty=&Submit=Add

Time:
Thursday, June 03, 2004, 11:44:25 AM


More information:
Microsoft Support
please help me


Reply With Quote