Advertisement

07.23.2008 at 11:55AM PDT, ID: 23589693
[x]
Attachment Details

ASP SQL SYNTAX ERROR

Asked by jimes82 in Active Server Pages (ASP), SQL Query Syntax

Tags: , , ,

I am trying to put together a simple web app for deleting and adding new posts.

I have a form setup on addnew.asp here is the form code
<form name="addnew" method="post" action="addcodage.asp">

addcodage.asp:

here is the ASP code where it breaks.
 <%  
frm_dbID = Request.Form("ID")
frm_dbDate = Request.Form("DATE")
frm_dbPosition = Request.Form("POSITION")
frm_dbDepartment = Request.Form("DEPARTMENT")
frm_dbDescription = Request.Form("DESCRIPTION")
frm_dbRate = Request.Form("RATE")
frm_dbvisible = Request.Form("VISIBLE")
frm_dbPTFT = Request.Form("PTFT")
frm_dbFile = Request.Form("File")

SQLText = "INSERT INTO Posting (ID, DATE, POSITION, DEPARTMENT, DESCRIPTION, RATE, VISIBLE, PTFT, File) VALUES (" & frm_dbID & "," & frm_dbDate & ",'"& frm_dbPosition & "','" & frm_dbDepartment & "','" & frm_dbDescription & "','" & frm_dbRate & "','"  & frm_dbvisible & "','"  & frm_dbPTFT & "','"  & frm_dbFile & "')"

SQLUser="Provider=SQLOLEDB.1;User ID=****;PASSWORD=****;Initial Catalog=Employment;Data Source=DCABSQL01c"
set recordset = server.createobject("adodb.recordset") <--------BREAKS ON THIS LINE
recordset.open SQLText, SQLUser, 3, 3
      
Response.write(SQLTEXT)

Response.write("<P> Post Successfully Added")

'Do while not Recordset.Eof
'Set Recordset = Nothing
%>

i know i'm doing something simple wrong, if i comment out set recordset and recordset.open everything works but it obviously doesn't insert it into the database.  any suggestions?Start Free Trial
[+][-]07.23.2008 at 11:58AM PDT, ID: 22072631

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]07.23.2008 at 11:59AM PDT, ID: 22072630

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]07.23.2008 at 12:05PM PDT, ID: 22072697

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]07.23.2008 at 12:15PM PDT, ID: 22072801

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]07.23.2008 at 12:17PM PDT, ID: 22072818

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]07.23.2008 at 12:20PM PDT, ID: 22072855

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]07.23.2008 at 12:23PM PDT, ID: 22072879

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]07.23.2008 at 12:25PM PDT, ID: 22072902

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: Active Server Pages (ASP), SQL Query Syntax
Tags: ASP, SQL, Internet Explorer, Firefox, Safari, etc..., N/A, Incorrect syntax near the keyword 'File'.
Sign Up Now!
Solution Provided By: _Stilgar_
Participating Experts: 3
Solution Grade: A
 
 
[+][-]07.23.2008 at 12:49PM PDT, ID: 22073102

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628