Home : General : Databases and SQL :

General: Databases and SQL: Re: [yogi] Help desperately needed: Edit Log

Here is the list of edits for this post
Re: [yogi] Help desperately needed
Here are the codes

survey.asp

-----------------------------------------------------------

<form name="form1" method="post" action="record.asp">
<table width="75%" border="1">
<tr>
<td width="11%"><div align="right"><strong>Name :</strong></div></td>
<td width="22%"><input type="text" name="id"></td>
<td width="12%"><div align="right"><strong>Bagde No :</strong></div></td>
<td width="55%"><input type="text" name="badgeno"></td>
</tr>
</table>
<table width="75%" border="1">
<tr>
.......................................

.....................................

<input type="radio" name="yes" >
<strong>Yes</strong></div></td>
<td width="26%"><div align="center">
<input type="radio" name="no" >
<strong>No</strong></div></td>
</tr>
</table>
.....................................

.......................................

<input type="checkbox" name="ch1" >
<strong>Design Workstations</strong><br>
</p></td>
</tr>
<tr>
<td><input type="checkbox" name="ch2">
<strong> IMAN/UG Licenses </strong></td>
</tr>
<tr>
<td><input type="checkbox" name="ch3">
<strong>Meals (esp Dinner)</strong> </td>
</tr>
<tr>
<td><input type="checkbox" name="ch4"> <strong>System Support </strong></td>
</tr>
<tr>
<td><input type="checkbox" name="ch5">
<strong>Family (eg. baby to look after.etc)</strong></td>
</tr>
<tr>
<td><input type="checkbox" name="ch6">
.....................

<td width="49%"><div align="right"><strong>Remarks : </strong></div></td>
<td width="51%"><textarea name="remarks"></textarea></td>
</tr>
</table>
<table width="75%" border="1">
<tr>
<td width="49%"><div align="right">
<input type="submit" name="Submit" value="Submit">
</div></td>
<td width="51%"><input type="reset" name="reset" value="Reset"></td>
.............
record.asp

-----------------------------------------------------------------------------

<%
Dim conn, connStr
Set conn = Server.CreateObject("ADODB.Connection")
connStr = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath("db1.mdb")
conn.open connStr
%>

<!-- #include file="inc/adoeg-mylib.inc" -->
<%
Dim sql, rs, Id, Badgeno, Yes, No, Ch1, Ch2, Ch3, Ch4, Ch5, Ch6, Remarks

Id=Request.form("id")
Badgeno=Request.form("badgeno")
Yes=Request.form("yes")
No=Request.form("no")
Ch1=Request.form("ch1")
Ch2=Request.form("ch2")
Ch3=Request.form("ch3")
Ch4=Request.form("ch4")
Ch5=Request.form("ch5")
Ch6=Request.form("ch6")
Remarks=Request.form("remarks")

sql = "INSERT INTO survey ([id],[badgeno],[yes],[no],[ch1],[ch2],[ch3],[ch4],[ch5],[ch6],[remarks]) VALUES ('" & Id & "','" & Badgeno & "','" & Yes & "','" & No & "','" & Ch1 & "','" & Ch2 & "','" & Ch3 & "','"& Ch4 & "','"& Ch5 & "','"& Ch6 & "','"& Remarks & ")"
Set rs=conn.execute(sql)

%>



----------------

somehow when i try to run the form

it says that there is a syntax error in the insert into statement

i am not sure what is the problem, is it that my database is wrong or is it that my statement is incorrect?

please help me

thanks

Last edited by:

Yukiko: Sep 25, 2003, 11:23 PM

Edit Log: