Click here to Skip to main content
15,888,112 members
Home / Discussions / Web Development
   

Web Development

 
GeneralRe: Go to the speciifed text Pin
Johnny ²4-Dec-07 11:54
Johnny ²4-Dec-07 11:54 
Generalresize web page 'n' menu control Pin
trilokharry3-Dec-07 18:18
trilokharry3-Dec-07 18:18 
GeneralRe: resize web page 'n' menu control Pin
Vasudevan Deepak Kumar4-Dec-07 21:50
Vasudevan Deepak Kumar4-Dec-07 21:50 
Generalcaching problem with IE Pin
JimmyRopes3-Dec-07 16:23
professionalJimmyRopes3-Dec-07 16:23 
Generalto chek the input data is string or integer Pin
idsanjeevjha3-Dec-07 16:12
idsanjeevjha3-Dec-07 16:12 
GeneralRe: to chek the input data is string or integer Pin
Michael Sync5-Dec-07 15:13
Michael Sync5-Dec-07 15:13 
GeneralRe: to chek the input data is string or integer Pin
Sathesh Sakthivel5-Dec-07 18:11
Sathesh Sakthivel5-Dec-07 18:11 
QuestionInsert Statement error Pin
Paul McGann1-Dec-07 5:57
professionalPaul McGann1-Dec-07 5:57 
I have an asp file linked to a html file with the following code:

<%
Dim rs, conn
set conn = Server.CreateObject("ADODB.connection")
set rs = Server.CreateObject("ADODB.Recordset")
conn.Provider="Microsoft.Jet.OLEDB.4.0"
conn.Open(Server.Mappath("obesity.mdb"))

age = request("age")
gender = request("gender")
height = request("height")
weight = request("weight")
waist = request("waist")

sqlstring = "Insert INTO User ([Age], [Gender], [Height], [Weight], [Waist]) Values(" & age & ",'" & gender & "'," & height & "," & weight & "," & waist & ")"

rs.Open sqlstring, conn

sqlstring = "Select * From User Order By age"

rs.Open sqlstring, conn

Response.Write "<TABLE BORDER=0><TR><TD width=100><u><strong>age</strong></u></TD><TD width=100><u><strong>Gender</strong></u></TD><TD width=100><u><strong>Height</strong></u></TD><TD width=100><u><strong>Weight</strong></u></TD><TD width=100><u><strong>Waist</strong></u></TD></TR><TR>"

while not rs.EOF
Response.Write "<TD width=100>" & rs("age") & "</TD>"
Response.Write "<TD width=100>" & rs("gender") & "</TD>"
Response.Write "<TD width=100>" & rs("height") & "</TD>"
Response.Write "<TD width=100>" & rs("weight") & "</TD>"
Response.Write "<TD width=100>" & rs("waist") & "</TD>"
Response.Write "</TR>"
rs.MoveNext
wend

Response.Write "</TABLE>"
rs.Close
%>

When ever i execute this however it comes up with the following error message:

Microsoft JET Database Engine (0x80040E14)
Syntax error in INSERT INTO statement.

If anyone can spot where I'm going wrong can you let me know. The table in the database looks as follows:

Age - number
Gender - text
Height - number
Weight - number
Waist - number

Thank You
AnswerRe: Insert Statement error Pin
Guffa1-Dec-07 6:28
Guffa1-Dec-07 6:28 
GeneralRe: Insert Statement error Pin
Paul McGann1-Dec-07 6:32
professionalPaul McGann1-Dec-07 6:32 
GeneralRe: Insert Statement error Pin
Shog91-Dec-07 10:49
sitebuilderShog91-Dec-07 10:49 
AnswerRe: Insert Statement error Pin
Paul Conrad1-Dec-07 9:54
professionalPaul Conrad1-Dec-07 9:54 
QuestionQuestion : Pin
sandeep_n1-Dec-07 3:23
sandeep_n1-Dec-07 3:23 
AnswerAnswer : Pin
Guffa1-Dec-07 5:46
Guffa1-Dec-07 5:46 
AnswerRe: Question : Pin
Paul Conrad1-Dec-07 9:55
professionalPaul Conrad1-Dec-07 9:55 
QuestionRegular Expression [modified] Pin
ganeshMohan1-Dec-07 1:01
ganeshMohan1-Dec-07 1:01 
AnswerRe: Regular Expression Pin
pmarfleet1-Dec-07 2:37
pmarfleet1-Dec-07 2:37 
Questionfixed table row or table data Pin
idsanjeevjha1-Dec-07 0:11
idsanjeevjha1-Dec-07 0:11 
AnswerRe: fixed table row or table data Pin
Johnny ²1-Dec-07 13:03
Johnny ²1-Dec-07 13:03 
QuestionUsage of "long" in oracle database Pin
gReaen30-Nov-07 21:41
gReaen30-Nov-07 21:41 
GeneralRe: Usage of "long" in oracle database Pin
Michael Sync3-Dec-07 16:12
Michael Sync3-Dec-07 16:12 
Questiontesting Pin
myprogs30-Nov-07 14:58
myprogs30-Nov-07 14:58 
AnswerRe: testing Pin
Paul Conrad1-Dec-07 9:55
professionalPaul Conrad1-Dec-07 9:55 
Questionready made web sites Pin
myprogs30-Nov-07 14:57
myprogs30-Nov-07 14:57 
AnswerRe: ready made web sites Pin
Christian Graus1-Dec-07 9:41
protectorChristian Graus1-Dec-07 9:41 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.