Gossamer Forum
Home : General : Databases and SQL :

Help desperately needed

Quote Reply
Help desperately needed
Hi guys

i am doing a survey form with asp

i tried to have all the information stored in a database using SQL.

somehow the information cannot get in.

can u all give me a hand to correct the errors???

attached is the zip files for the form

the files are as above
> survey.asp - the feedback form
> record.asp - the sql form
> db1.asp - the database

will any kind soul out there
please help me correct the error and let me know asap

thanks

Last edited by:

Yukiko: Sep 25, 2003, 10:41 PM
Quote Reply
Re: [Yukiko] Help desperately needed In reply to
Hi

I have removed your post in the Links SQL forum, since it was not appropriate there.

I would suggest you post some error messages you are getting, or you try to narrow down your problem. People here are willing to help, but they usually don't like to go through multiple files to find out where an error could be.

I hope this helps.

Ivan
-----
Iyengar Yoga Resources / GT Plugins
Quote Reply
Re: [yogi] Help desperately needed In reply to
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