|
| |
|
|
remnatch
Posts: 27 Joined: 7/6/2004 Status: offline
|
Syntax Error in INSERT INTO statement - 7/6/2004 11:27:06
Hey all, I'm not trying to double up, but I think I put this in the wrong forum to begin with. Sorry. After going through a search, I see that this is a popular problem. I tried a handful of solutions, and haven't been able to come up with a resolution to my problem. I'm attempting to take an html form and use it to update an access database via asp. Here's my code in its entirety.
<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<script language="javascript">
function form_Validator(form)
{
if (form.app_list.value =="")
{
alert("Please enter applications to be tested.");
form.app_list.focus();
return (false);
}
if (form.project_name.value =="")
{
alert ("Please enter your project name.");
form.project_name.focus();
return (false);
}
if (form.event_descript.value =="")
{
alert("Please enter your event description.");
form.event_descript.focus();
return (false);
}
if (form.event_date.value =="")
{
alert("Please enter event date.");
form.event_date.focus();
return(false);
}
if (form. event_start.value =="")
{
alert("Please enter start date.");
form.event_start.focus();
return(false);
}
if (form.event_end.value =="")
{
alert("Please enter end date.");
form.event_end.focus();
return(false);
}
if (form.requested.value =="")
{
alert("Please enter email.");
form.requested.focus();
return(false);
}
if (form.primary_contact.value == "")
{
alert("Please enter your name.");
form.primary_contact.focus();
return (false);
}
if (form.primary_info.value == "")
{
alert("Please enter your info.");
form.primary_info.focus();
return (false);
}
if (form.secondary_contact.value == "")
{
alert("Please enter secondary contact info.");
form.second_contact.focus();
return (false);
}
if (form.secondary_info.value == "")
{
alert("Please enter secondary contact info.");
form.secondary_info.focus();
return (false);
}
return (true);
}
//-->
</script>
<title>IPS Test Support Team</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css">
<!--
.style1 {font-family: Verdana, Arial, Helvetica, sans-serif}
.style2 {font-size: 9px}
.style3 {font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 9px; }
-->
</style>
</head>
<body>
<%
Dim environment, app_list, project_name, event_descript, event_date, event_start, event_end, requested, primary_contact, primary_info, secondary_contact, secondary_info, additional_support, comments
Function ChkString(string)
If string = "" Then string = " "
ChkString = Replace(string, "'", "''")
End Function
environment = ChkString(Request.Form("environ_pull"))
app_list = ChkString(Request.Form("app_list"))
project_name = ChkString(Request.Form("project_name"))
event_descript = ChkString(Request.Form("event_descript"))
event_date = ChkString(Request.Form("event_date"))
event_start = ChkString(Request.Form("event_start"))
event_end = ChkString(Request.Form("event_end"))
requested = ChkString(Request.Form("requested"))
primary_contact = ChkString(Request.Form("primary_contact"))
primary_info = ChkString(Request.Form("primary_info"))
secondary_contact = ChkString(Request.Form("secondary_contact"))
secondary_info = ChkString(Request.Form("secondary_info"))
additional_support = ChkString(Request.Form("additional_support"))
comments = ChkString(Request.Form("comments"))
data_source = "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" & _
Server.MapPath("supportrequest.mdb")
sql_insert = "insert into Request Support (environment, app_list, project_name, event_descript, event_date, event_start, event_end, requested, primary_contact, primary_info, secondary_contact, secondary_info, additional_support, comments)"
values = (environ_pull & " ', ' " &_
project_name & "', '" &_
event_descript & "', '" &_
event_date & "', '" &_
event_start & "', '" &_
event_end & "', '" &_
requested & "', '" &_
primary_contact & "', '" &_
primary_info & "', '" &_
secondary_contact & "', '" &_
secondary_info & "', '" &_
additional_support & "', '" &_
comments &")" )'
Set con = Server.CreateObject("ADODB.Connection")
con.Open data_source
con.Execute sql_insert
con.Close
Set con = Nothing
%>
<form name="form" method="post" action="request_support.asp" onSubmit=" return form_Validator(this)">
<table border="1" cellspacing="1" style="border-collapse: collapse; border-width: 0" bordercolor="#111111" width="100%" id="AutoNumber1">
<tr>
<td width="50%" style="border-style: none; border-width: medium">
<table width="518" border="1" cellpadding="0" cellspacing="0" bordercolor="#999999" id="AutoNumber6" style="border-collapse: collapse; float:left" height="482">
<tr>
<td width="518" bgcolor="#F7F7F7" valign="bottom" bordercolor="#800000" height="473"> <blockquote>
<p>
<span class="style2"> <br>
<span class="style3">
Environment:
<select name="environ_pull" size="5"select" style="font-family: Verdana" multiple>
<option>FAC</option>
<option>FIN</option>
<option>PAC</option>
<option>PIN</option>
<option>CustQA</option>
</select> Hold ctrl key for multiple selections</span></span></p>
<p class="style1 style2">
Applications :
<textarea name="app_list" cols="34" rows="3" id="app_list"></textarea>
<br>
<br>
Project Name:
<textarea name="project_name" cols="34" rows="3" id="project_name"></textarea></p>
<p class="style1 style2">
Testing Description:
<textarea name="event_descript" cols="34" rows="3" id="event _descript"></textarea>
</p>
<p class="style1 style2"> Testing Date:
<input name="event_date" type="text" id="event_date" size="11">
(MM/DD/YYYY) </p>
<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="41%" id="AutoNumber5" align="right">
<tr>
<td width="10%">
<img border="0" src="http://ips.fmr.com/IPSTest/images/image001.gif" align="left"></td>
</tr>
</table>
<p class="style1 style2"> Event Start Time:
<input name="event_start" type="text" id="event_start" size="11"> <br>
(HH : MM) 24 hr, EST</p>
<p class="style1 style2"> Event End Time:
<input name="event_end" type="text" id="event_end" size="11">
(HH : MM) 24 hr, EST</p>
</blockquote>
<p class="style2">
<p class="style2">
<p class="style2">
<p class="style2"></td>
</tr>
</table>
<div align="left" style="width: 518; height: 80; font-size: 9px; font-family: Verdana, Arial, Helvetica, sans-serif">
<table width="518" height="74" border="1" align="left" cellpadding="0" cellspacing="0" bordercolor="#999999" id="AutoNumber2" style="border-collapse: collapse">
<tr>
<td width="518" bgcolor="#F7F7F7" height="0"> <span class="style2"> <br>
<br>
Requested By:
<input name="requested" type="text" id="requested" size="21"> Enter your E -
mail.</span></td></tr>
</table>
<p><br>
<br>
</p>
<p></div>
<div align="left" style="width: 518; height: 377; font-size: 9px; font-family: Verdana, Arial, Helvetica, sans-serif">
<table width="518" height="74" border="1" cellpadding="0" cellspacing="0" bordercolor="#999999" id="AutoNumber3" style="border-collapse: collapse">
<tr>
<td width="518" height="74" bgcolor="#F7F7F7">
<blockquote>
<p>
<font size="1" face="Verdana"><span class="style2"> </span></font></p>
<p>
<font size="1" face="Verdana"><span class="style2">Contact Information 1:
<input name="primary_contact" type="text" id="first_name" size="31"></span></font></p>
<p><font size="1" face="Verdana"><span class="style2"> Contact Information 2:
<input name="primary_info" type="text" id="last_name" size="31"> </span></p>
<div align="left" class="style2" style="width: 435; height: 79">
Contact Information 3:
<input name="secondary_contact" type="text" id="secondary_contact" size="31"><p> Contact Information 4:
<input name="secondary_info" type"text" id= "secondary_info" size="31" "20">
<br>
</div>
<div align="left">
<span class="style2"> Do you require additional support
<select name="additional_support" size="1" id="additional_support" style="">
<option>Yes</option>
<option>No</option>
</select>
</span><br>
<br>
<span class="style2">Comments: </span>
<textarea name="comments" cols="34" rows="6" id="comments"></textarea>
<br>
</div>
</blockquote>
</td>
</tr>
</table>
</div>
<div align="center" style="width: 522; height: 90">
<table width="518" border="1" align="left" cellpadding="0" cellspacing="0" bordercolor="#999999" id="AutoNumber4" style="border-collapse: collapse">
<tr>
<td width="516" align="left" bgcolor="#F7F7F7">
<p align="center"><span class="style1"><font size="1"><br>
Note: This posting will
be queued and responded to within 48 hours.<br>
<br>
<input type="submit" name="Submit" value="Submit"> <br>
</font></span></td>
</tr>
</table>
</div>
<p></td>
<td width="50%" style="border-style: none; border-width: medium"> </td>
</tr>
</table>
</form>
</body>
</html> And just the ASP <%
Dim environment, app_list, project_name, event_descript, event_date, event_start, event_end, requested, primary_contact, primary_info, secondary_contact, secondary_info, additional_support, comments
Function ChkString(string)
If string = "" Then string = " "
ChkString = Replace(string, "'", "''")
End Function
environment = ChkString(Request.Form("environ_pull"))
app_list = ChkString(Request.Form("app_list"))
project_name = ChkString(Request.Form("project_name"))
event_descript = ChkString(Request.Form("event_descript"))
event_date = ChkString(Request.Form("event_date"))
event_start = ChkString(Request.Form("event_start"))
event_end = ChkString(Request.Form("event_end"))
requested = ChkString(Request.Form("requested"))
primary_contact = ChkString(Request.Form("primary_contact"))
primary_info = ChkString(Request.Form("primary_info"))
secondary_contact = ChkString(Request.Form("secondary_contact"))
secondary_info = ChkString(Request.Form("secondary_info"))
additional_support = ChkString(Request.Form("additional_support"))
comments = ChkString(Request.Form("comments"))
data_source = "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" & _
Server.MapPath("supportrequest.mdb")
sql_insert = "insert into Request Support (environment, app_list, project_name, event_descript, event_date, event_start, event_end, requested, primary_contact, primary_info, secondary_contact, secondary_info, additional_support, comments)"
values = (environ_pull & " ', ' " &_
project_name & "', '" &_
event_descript & "', '" &_
event_date & "', '" &_
event_start & "', '" &_
event_end & "', '" &_
requested & "', '" &_
primary_contact & "', '" &_
primary_info & "', '" &_
secondary_contact & "', '" &_
secondary_info & "', '" &_
additional_support & "', '" &_
comments &")" )'
Set con = Server.CreateObject("ADODB.Connection")
con.Open data_source
con.Execute sql_insert
con.Close
Set con = Nothing
%> Finally, the error message: Microsoft JET Database Engine error '80040e14' Syntax error in INSERT INTO statement. /ips/request_supportDB2.asp, line 141 Anyone who can shed light on my predicament will be my new best friend. Thanks natch
|
|
|
|
remnatch
Posts: 27 Joined: 7/6/2004 Status: offline
|
RE: Syntax Error in INSERT INTO statement - 7/6/2004 11:41:46
When I do fix the problem, altering the ASP as such: <%
Dim environment, app_list, project_name, event_descript, event_date, event_start, event_end, requested, primary_contact, primary_info, secondary_contact, secondary_info, additional_support, comments
Function ChkString(string)
If string = "" Then string = " "
ChkString = Replace(string, "'", "''")
End Function
environment = ChkString(Request.Form("environ_pull"))
app_list = ChkString(Request.Form("app_list"))
project_name = ChkString(Request.Form("project_name"))
event_descript = ChkString(Request.Form("event_descript"))
event_date = ChkString(Request.Form("event_date"))
event_start = ChkString(Request.Form("event_start"))
event_end = ChkString(Request.Form("event_end"))
requested = ChkString(Request.Form("requested"))
primary_contact = ChkString(Request.Form("primary_contact"))
primary_info = ChkString(Request.Form("primary_info"))
secondary_contact = ChkString(Request.Form("secondary_contact"))
secondary_info = ChkString(Request.Form("secondary_info"))
additional_support = ChkString(Request.Form("additional_support"))
comments = ChkString(Request.Form("comments"))
data_source = "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" & _
Server.MapPath("supportrequest.mdb")
sql_insert = "insert into Request Support (environment, app_list, project_name, event_descript, event_date, event_start, event_end, requested, primary_contact, primary_info, secondary_contact, secondary_info, additional_support, comments)"
values(environ_pull & " ', ' " &_
project_name & "', '" &_
event_descript & "', '" &_
event_date & "', '" &_
event_start & "', '" &_
event_end & "', '" &_
requested & "', '" &_
primary_contact & "', '" &_
primary_info & "', '" &_
secondary_contact & "', '" &_
secondary_info & "', '" &_
additional_support & "', '" &_
comments &"')'" I get this error. Microsoft VBScript compilation error '800a03ee' Expected ')' /ips/request_supportDB2.asp, line 136 comments &"')'" ---------------^ Even if I add the expected ')', it still asks me to add two or three more. Any ideas? natch.
|
|
|
|
rdouglass
Posts: 9280 From: Biddeford, ME USA Status: offline
|
RE: Syntax Error in INSERT INTO statement - 7/6/2004 14:00:16
quote:
sql_insert = "insert into Request Support (environment, app_list, project_name, event_descript, event_date, event_start, event_end, requested, primary_contact, primary_info, secondary_contact, secondary_info, additional_support, comments)" values(environ_pull & " ', ' " &_ project_name & "', '" &_ event_descript & "', '" &_ event_date & "', '" &_ event_start & "', '" &_ event_end & "', '" &_ requested & "', '" &_ primary_contact & "', '" &_ primary_info & "', '" &_ secondary_contact & "', '" &_ secondary_info & "', '" &_ additional_support & "', '" &_ comments &"')'" I would do this: sql_insert = "insert into [Request Support] (environment, app_list, project_name, event_descript, event_date, event_start, event_end, requested, primary_contact, primary_info, secondary_contact, secondary_info, additional_support, comments)" sql_insert = sql_insert & " values ('" & environ_pull & " ', ' " & project_name & "', '" & event_descript & "', '" & event_date & "', '" & event_start & "', '" & event_end & "', '" & requested & "', '" & primary_contact & "', '" & primary_info & "', '" & secondary_contact & "', '" & secondary_info & "', '" & additional_support & "', '" & comments &"')" Something like that? And if your DB is Access and they are dat/time fields, you'll need to delimit them with #'s like so: ...event_descript & "', #" & event_date & "#, #" & event_start & "#, #" & event_end & "#, '" & requested ... Hope it helps.
_____________________________
Don't take you're eye off your final destination. ASP Checkbox Function Tutorial.
|
|
|
|
remnatch
Posts: 27 Joined: 7/6/2004 Status: offline
|
RE: Syntax Error in INSERT INTO statement - 7/6/2004 15:20:28
First, thanks for the help. Now to the problem. I changed my code to mirror yours, and am now recieving a different error. quote:
Microsoft JET Database Engine error '80040e14' Number of query values and destination fields are not the same. /ips/request_supportDB2.asp, line 132 I have an autonumber field as my primary key, which I haven't added as it is not part of the form. Could this be the issue. Also, as suggested by another programmer, I added Response.write sql_insert Response.end after Set con = Server.CreateObject("ADODB.Connection") con.Open data_source but when I went to access the form, it merely wrote quote:
insert into [Request Support] (environment, app_list, project_name, event_descript, event_date, event_start, event_end, requested, primary_contact, primary_info, secondary_contact, secondary_info, additional_support, comments) values (' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ') Ignoring my html. Any ideas? natch.
|
|
|
|
rdouglass
Posts: 9280 From: Biddeford, ME USA Status: offline
|
RE: Syntax Error in INSERT INTO statement - 7/6/2004 15:31:46
quote:
insert into [Request Support] (environment, app_list, project_name, event_descript, event_date, event_start, event_end, requested, primary_contact, primary_info, secondary_contact, secondary_info, additional_support, comments) values (' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ') Yup. It lloks like you're not grabbing values. My bad - I assumed you already grabbed 'em and placed them into variables. Try ssomething like this: ... sql_insert = "insert into [Request Support] (environment, app_list, project_name, event_descript, event_date, event_start, event_end, requested, primary_contact, primary_info, secondary_contact, secondary_info, additional_support, comments)" sql_insert = sql_insert & " values ('" & Request.form("environ_pull") & " ', ' " & Request.form("project_name") & "', '" & .... Is that any better? EDIT: After re-reading your initial post, it looks like you are doing your Request.form items. Are you posting something to this page?
< Message edited by rdouglass -- 7/6/2004 15:33:43 >
_____________________________
Don't take you're eye off your final destination. ASP Checkbox Function Tutorial.
|
|
|
|
remnatch
Posts: 27 Joined: 7/6/2004 Status: offline
|
RE: Syntax Error in INSERT INTO statement - 7/6/2004 15:39:28
I'm attempting to send an email from the form, as well as write to a database, and return with a redirect page in case the individual wants to submit a second request. The email code is perfect, and has been omitted to work on the database entry.
|
|
|
|
remnatch
Posts: 27 Joined: 7/6/2004 Status: offline
|
RE: Syntax Error in INSERT INTO statement - 7/6/2004 15:42:21
First off, thanks for all the wonderful help that I've been recieving. I'm almost there. Now, I'm being given this error message, which I'm not understanding at all. Microsoft JET Database Engine error '80004005' Operation must use an updateable query. /ips/request_supportDB2.asp, line 131
|
|
|
|
rdouglass
Posts: 9280 From: Biddeford, ME USA Status: offline
|
RE: Syntax Error in INSERT INTO statement - 7/7/2004 9:40:04
Can you response.write your SQL again since you've made the changes?
_____________________________
Don't take you're eye off your final destination. ASP Checkbox Function Tutorial.
|
|
|
|
remnatch
Posts: 27 Joined: 7/6/2004 Status: offline
|
RE: Syntax Error in INSERT INTO statement - 7/7/2004 9:42:14
No, I still recieve the same error, where my form disappears and the code merely writes the values as text.
|
|
|
|
rdouglass
Posts: 9280 From: Biddeford, ME USA Status: offline
|
RE: Syntax Error in INSERT INTO statement - 7/7/2004 9:50:29
quote:
code merely writes the values as text. Can you explain a little more? I'm just looking for the results of something like: Response.write(sql_insert)
_____________________________
Don't take you're eye off your final destination. ASP Checkbox Function Tutorial.
|
|
|
|
remnatch
Posts: 27 Joined: 7/6/2004 Status: offline
|
RE: Syntax Error in INSERT INTO statement - 7/7/2004 12:56:38
Instead of posting my form, when I post the Response.write tag, It just displays the sql_insert information. This: quote:
insert into [Request Support] (environment, app_list, project_name, event_descript, event_date, event_start, event_end, requested, primary_contact, primary_info, secondary_contact, secondary_info, additional_support, comments) values (' ', ' ',' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ') Is all I get.
|
|
|
|
rdouglass
Posts: 9280 From: Biddeford, ME USA Status: offline
|
RE: Syntax Error in INSERT INTO statement - 7/7/2004 14:04:25
quote:
It just displays the sql_insert information. Exactly what I'm looking for. From what you posted, you're not getting any data into your SQL string. What happens if you hardcode values into sql_insert? IOW take the Request.form stuff right out of the picture. If all your fields aren't required by the DB, try just a simple one: sql_insert = "INSERT INTO [Request Support] (environment) VALUES ('test')" and see if you still get errors. That should be able to separate a DB error vs. a data collection error. Any help there?
_____________________________
Don't take you're eye off your final destination. ASP Checkbox Function Tutorial.
|
|
|
|
remnatch
Posts: 27 Joined: 7/6/2004 Status: offline
|
RE: Syntax Error in INSERT INTO statement - 7/8/2004 11:24:47
Hey all, I've got the form so it's now writing to the database. Only problem is, it's not writing anything. The entries are all blank. My other issue is that the form, despite having the email code removed, is still sending me an email every time I send the form. While this is the intended goal in the end, I'm wondering why it's doing it now. <%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<%
' FileName="Connection_odbc_conn_dsn.htm"
' Type="ADO"
' DesigntimeType="ADO"
' HTTP="false"
' Catalog=""
' Schema=""
Dim MM_DBConnect_STRING
MM_DBConnect_STRING = "dsn=IPSDatabase;"
%>
<html>
<head>
<script language="javascript">
function form_Validator(form)
{
if (form.app_list.value =="")
{
alert("Please enter applications to be tested.");
form.app_list.focus();
return (false);
}
if (form.project_name.value =="")
{
alert ("Please enter your project name.");
form.project_name.focus();
return (false);
}
if (form.event_descript.value =="")
{
alert("Please enter your event description.");
form.event_descript.focus();
return (false);
}
if (form.event_date.value =="")
{
alert("Please enter event date.");
form.event_date.focus();
return(false);
}
if (form. event_start.value =="")
{
alert("Please enter start date.");
form.event_start.focus();
return(false);
}
if (form.event_end.value =="")
{
alert("Please enter end date.");
form.event_end.focus();
return(false);
}
if (form.requested.value =="")
{
alert("Please enter email.");
form.requested.focus();
return(false);
}
if (form.primary_contact.value == "")
{
alert("Please enter your name.");
form.primary_contact.focus();
return (false);
}
if (form.primary_info.value == "")
{
alert("Please enter your info.");
form.primary_info.focus();
return (false);
}
if (form.secondary_contact.value == "")
{
alert("Please enter secondary contact info.");
form.second_contact.focus();
return (false);
}
if (form.secondary_info.value == "")
{
alert("Please enter secondary contact info.");
form.secondary_info.focus();
return (false);
}
return (true);
}
//-->
</script>
<title>IPS Test Support Team</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css">
<!--
.style1 {font-family: Verdana, Arial, Helvetica, sans-serif}
.style2 {font-size: 9px}
.style3 {font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 9px; }
-->
</style>
</head>
<body>
<%
Dim environment, app_list, project_name, event_descript, event_date, event_start, event_end, requested, primary_contact, primary_info, secondary_contact, secondary_info, additional_support, comments
Function ChkString(string)
If string = "" Then string = " "
ChkString = Replace(string, "'", "''")
End Function
environment = ChkString(Request.Form("environ_pull"))
app_list = ChkString(Request.Form("app_list"))
project_name = ChkString(Request.Form("project_name"))
event_descript = ChkString(Request.Form("event_descript"))
event_date = ChkString(Request.Form("event_date"))
event_start = ChkString(Request.Form("event_start"))
event_end = ChkString(Request.Form("event_end"))
requested = ChkString(Request.Form("requested"))
primary_contact = ChkString(Request.Form("primary_contact"))
primary_info = ChkString(Request.Form("primary_info"))
secondary_contact = ChkString(Request.Form("secondary_contact"))
secondary_info = ChkString(Request.Form("secondary_info"))
additional_support = ChkString(Request.Form("additional_support"))
comments = ChkString(Request.Form("comments"))
sql_insert = "insert into [Request Support] (environment, app_list, project_name, event_descript, event_date, event_start, event_end, requested, primary_contact, primary_info, secondary_contact, secondary_info, additional_support, comments)"
sql_insert = sql_insert & " values ('" & environ_pull & " ', ' " & applist & "','" & project_name & "', '" & event_descript & "', '" & event_date & "', '" & event_start & "', '" & event_end & "', '" & requested & "', '" & primary_contact & "', '" & primary_info & "', '" & secondary_contact & "', '" & secondary_info & "', '" & additional_support & "', '" & comments &"')"
set PCInsert = Server.CreateObject("ADODB.Command")
PCInsert.ActiveConnection = "IPSDatabase"
PCInsert.CommandText = sql_insert
PCInsert.CommandType = 1
PCInsert.CommandTimeout = 0
PCInsert.Prepared = true
PCInsert.Execute(sql_insert)
%>
<form name="form" method="post" action="request_support.asp" onSubmit=" return form_Validator(this)">
<table border="1" cellspacing="1" style="border-collapse: collapse; border-width: 0" bordercolor="#111111" width="100%" id="AutoNumber1">
<tr>
<td width="50%" style="border-style: none; border-width: medium">
<table width="518" border="1" cellpadding="0" cellspacing="0" bordercolor="#999999" id="AutoNumber6" style="border-collapse: collapse; float:left" height="482">
<tr>
<td width="518" bgcolor="#F7F7F7" valign="bottom" bordercolor="#800000" height="473"> <blockquote>
<p>
<span class="style2"> <br>
<span class="style3">
Environment:
<select name="environ_pull" size="5"select" style="font-family: Verdana" multiple>
<option>FAC</option>
<option>FIN</option>
<option>PAC</option>
<option>PIN</option>
<option>CustQA</option>
</select> Hold ctrl key for multiple selections</span></span></p>
<p class="style1 style2">
Applications :
<textarea name="app_list" cols="34" rows="3" id="app_list"></textarea>
<br>
<br>
Project Name:
<textarea name="project_name" cols="34" rows="3" id="project_name"></textarea></p>
<p class="style1 style2">
Testing Description:
<textarea name="event_descript" cols="34" rows="3" id="event _descript"></textarea>
</p>
<p class="style1 style2"> Testing Date:
<input name="event_date" type="text" id="event_date" size="11">
(MM/DD/YYYY) </p>
<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="41%" id="AutoNumber5" align="right">
<tr>
<td width="10%">
<img border="0" src="http://ips.fmr.com/IPSTest/images/image001.gif" align="left"></td>
</tr>
</table>
<p class="style1 style2"> Event Start Time:
<input name="event_start" type="text" id="event_start" size="11"> <br>
(HH : MM) 24 hr, EST</p>
<p class="style1 style2"> Event End Time:
<input name="event_end" type="text" id="event_end" size="11">
(HH : MM) 24 hr, EST</p>
</blockquote>
<p class="style2">
<p class="style2">
<p class="style2">
<p class="style2"></td>
</tr>
</table>
<div align="left" style="width: 518; height: 80; font-size: 9px; font-family: Verdana, Arial, Helvetica, sans-serif">
<table width="518" height="74" border="1" align="left" cellpadding="0" cellspacing="0" bordercolor="#999999" id="AutoNumber2" style="border-collapse: collapse">
<tr>
<td width="518" bgcolor="#F7F7F7" height="0"> <span class="style2"> <br>
<br>
Requested By:
<input name="requested" type="text" id="requested" size="21"> Enter your E -
mail.</span></td></tr>
</table>
<p><br>
<br>
</p>
<p></div>
<div align="left" style="width: 518; height: 377; font-size: 9px; font-family: Verdana, Arial, Helvetica, sans-serif">
<table width="518" height="74" border="1" cellpadding="0" cellspacing="0" bordercolor="#999999" id="AutoNumber3" style="border-collapse: collapse">
<tr>
<td width="518" height="74" bgcolor="#F7F7F7">
<blockquote>
<p>
<font size="1" face="Verdana"><span class="style2"> </span></font></p>
<p>
<font size="1" face="Verdana"><span class="style2">Contact Information 1:
<input name="primary_contact" type="text" id="first_name" size="31"></span></font></p>
<p><font size="1" face="Verdana"><span class="style2"> Contact Information 2:
<input name="primary_info" type="text" id="last_name" size="31"> </span></p>
<div align="left" class="style2" style="width: 435; height: 79">
Contact Information 3:
<input name="secondary_contact" type="text" id="secondary_contact" size="31"><p> Contact Information 4:
<input name="secondary_info" type"text" id= "secondary_info" size="31" "20">
<br>
</div>
<div align="left">
<span class="style2"> Do you require additional support
<select name="additional_support" size="1" id="additional_support" style="">
<option>Yes</option>
<option>No</option>
</select>
</span><br>
<br>
<span class="style2">Comments: </span>
<textarea name="comments" cols="34" rows="6" id="comments"></textarea>
<br>
</div>
</blockquote>
</td>
</tr>
</table>
</div>
<div align="center" style="width: 522; height: 90">
<table width="518" border="1" align="left" cellpadding="0" cellspacing="0" bordercolor="#999999" id="AutoNumber4" style="border-collapse: collapse">
<tr>
<td width="516" align="left" bgcolor="#F7F7F7">
<p align="center"><span class="style1"><font size="1"><br>
Note: This posting will
be queued and responded to within 48 hours.<br>
<br>
<input type="submit" name="Submit" value="Submit"> <br>
</font></span></td>
</tr>
</table>
</div>
<p></td>
<td width="50%" style="border-style: none; border-width: medium"> </td>
</tr>
</table>
</form>
</body>
</html> If anyone can help me finish this up, I'll really appreciate it. natch.
|
|
|
|
remnatch
Posts: 27 Joined: 7/6/2004 Status: offline
|
RE: Syntax Error in INSERT INTO statement - 7/8/2004 17:13:28
First, Thanks for the help thus far. Secondly, the server was caching the ASP files, so we switched servers to test. The form will connect to the database, but won't write its contents in the form fields. Other than that... it's working fine. I guess. Any ideas? natch.
|
|
|
|
remnatch
Posts: 27 Joined: 7/6/2004 Status: offline
|
RE: Syntax Error in INSERT INTO statement - 7/8/2004 17:41:24
Form Field to the Database. Sorry about the confusion.
|
|
|
|
remnatch
Posts: 27 Joined: 7/6/2004 Status: offline
|
RE: Syntax Error in INSERT INTO statement - 7/9/2004 11:52:37
The form is meant to work on the exact same idea as my Email form. Visitors insert their information to a form, which is then written to a database. The code will eventually combine with the email form to send an email to the concerned parties as well. When I used the email form, the form would write specifically to the email, giving me no problems. Here, I can connect to the database, but the entries are blank. My intent was to have the code read the user input from the form and use that as the values which would then be inserted into the database.
|
|
|
|
remnatch
Posts: 27 Joined: 7/6/2004 Status: offline
|
RE: Syntax Error in INSERT INTO statement - 7/13/2004 15:55:27
I've re-written my code completely, separated the form from the asp code, and thought I had the problem solved. Now I'm getting a completely different error. <%@LANGUAGE="VBSCRIPT"%>
<!--#include file="Connections/DBConnect.asp" -->
<!--#include file="global.asa" -->
<%
Set rsDBConnect = Server.CreateObject("ADODB.Recordset")
rsDBConnect.ActiveConnection = DBConnect
If (Request.Form("Submit") = "Update") Then
rsDBConnect.Source = "SELECT environment, app_list, project_name, event_descript, event_date, event_start, event_end, requested, primary_contact, primary_info, secondary_contact, secondary_info, additional_support, comments FROM [Request Support]"
Else
rsDBConnect.Source = "SELECT environment, app_list, project_name, event_descript, event_date, event_start, event_end, requested, primary_contact, primary_info, secondary_contact, secondary_info, additional_support, comments FROM [Request Support]"
End If
rsDBConnect.CursorType = 2
rsDBConnect.CursorLocation = 2
rsDBConnect.LockType = 3
rsDBConnect.Open()
If (Request.Form("Submit") <> "Update") Then
rs.Addnew
End If
rsDBConnect("environment")=Request.Form("environment")
rsDBConnect("app_list")=Request.Form("app_list")
rsDBConnect("project_name")=Request.Form("project_name")
rsDBConnect("event_descript")=Request.Form("event_descript")
rsDBConnect("event_date")=Request.Form("event_date")
rsDBConnect("event_start")=Request.Form("event_start")
rsDBConnect("event_end")=Request.Form("event_end")
rsDBConnect("requested")=Request.Form("requested")
rsDBConnect("primary_contact")=Request.Form("primary_contact")
rsDBConnect("primary_info")=Request.Form("primary_info")
rsDBConnect("secondary_contact")=Request.Form("secondary_contact")
rsDBConnect("secondary_info")=Request.Form("secondary_info")
rsDBConnect("additional_support")=Request.Form("additional_support")
rsDBConnect("comments")=Request.Form("comments")
If (Request.Form("Submit") = "Update") Then
rsDBConnect("Active")=Request.Form("C_Active")
End If
rsDBConnect.Update()
rsDBConnect.Close()
Set rsDBConnect = Nothing
Set rsDBConnect = Server.CreateObject("ADODB.Recordset")
rsDBConnect.ActiveConnection = MM_DBConnect_STRING
rsDBConnect.Source = "SELECT environment, app_list, project_name, event_descript, event_date, event_start, event_end, requested, primary_contact, primary_info, secondary_contact, secondary_info, additional_support, comments FROM [Request Support]"
rsDBConnect.CursorType = 2
rsDBConnect.CursorLocation = 2
rsDBConnect.LockType = 3
rsDBConnect.Open()
If (Request.Form("Submit") = "Update") Then
Response.Redirect("verification.htm")
Else
Response.Redirect("verification.htm?ID=" & rsDBConnectT.Fields.Item("ID").Value & "&env=" & rsDBConnectT.Fields.Item("environment").Value)
End If
%> quote:
ADODB.Recordset error '800a0bb9' Arguments are of the wrong type, are out of acceptable range, or are in conflict with one another. /ips/request_supportDB2_trans.asp, line 6 I hate to be a pain, but does anyone have any ideas? natch.
|
|
New Messages |
No New Messages |
Hot Topic w/ New Messages |
Hot Topic w/o New Messages |
Locked w/ New Messages |
Locked w/o New Messages |
|
Post New Thread
Reply to Message
Post New Poll
Submit Vote
Delete My Own Post
Delete My Own Thread
Rate Posts
|
|
|