If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > ASP > SQL Stmt in ASP page as VBScript

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 02-18-03, 12:16
jainpriyanka jainpriyanka is offline
Registered User
 
Join Date: Jan 2003
Posts: 7
SQL Stmt in ASP page as VBScript

I have the following insert statement
SQLStmt = "INSERT INTO SmartScreen_Items (Chart, Date, Name, [Control Type], [Load Order], Data)" & _
"Values ('" & sChart & "', '" & sDate & "', '" & sName & "', 0, " & sLoadOrder & "," & _
" '" & sData & "')"

I am getting a sytax error on this statement. I have checked the Table it has exactly the same fields and also all are text fields except the Control type and load order.

Thanx
Reply With Quote
  #2 (permalink)  
Old 02-18-03, 12:33
andrewst andrewst is offline
Moderator.
 
Join Date: Sep 2002
Location: UK
Posts: 5,171
Re: SQL Stmt in ASP page as VBScript

Quote:
Originally posted by jainpriyanka
I have the following insert statement
SQLStmt = "INSERT INTO SmartScreen_Items (Chart, Date, Name, [Control Type], [Load Order], Data)" & _
"Values ('" & sChart & "', '" & sDate & "', '" & sName & "', 0, " & sLoadOrder & "," & _
" '" & sData & "')"

I am getting a sytax error on this statement. I have checked the Table it has exactly the same fields and also all are text fields except the Control type and load order.

Thanx
Suggest you do the usual debug just after that line:

Response.Write SQLStmt
Response.End

That will show you the actual SQL that is going to be executed. Look out for (e.g.):

INSERT... Values ('A','B',,'D')

(two commas in a row)
__________________
Tony Andrews
http://tinyurl.com/tonyandrews
Reply With Quote
  #3 (permalink)  
Old 02-18-03, 18:01
Shineyshoes Shineyshoes is offline
Registered User
 
Join Date: Jan 2003
Posts: 22
reserved word?

I think "Date" is a reserved word......try using [Date]
Reply With Quote
  #4 (permalink)  
Old 02-21-03, 13:22
jainpriyanka jainpriyanka is offline
Registered User
 
Join Date: Jan 2003
Posts: 7
Re: reserved word?

Thanks a bunch!

Quote:
Originally posted by Shineyshoes
I think "Date" is a reserved word......try using [Date]
Reply With Quote
  #5 (permalink)  
Old 02-25-03, 05:16
rhs98 rhs98 is offline
Super Moderator
 
Join Date: Feb 2002
Location: Hampshire, UK
Posts: 441
If that didn't work, I did notice you don't have a space after the end of the first set of () - it just goes ")values". It shoud be ") values" no?
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On