ASP & VB and Unterminated String Constant

Reply

Join Date: Dec 2007
Posts: 6
Reputation: vicshoup is an unknown quantity at this point 
Solved Threads: 0
vicshoup vicshoup is offline Offline
Newbie Poster

ASP & VB and Unterminated String Constant

 
0
  #1
Dec 19th, 2007
Can someone take a look at this and possibly tell me what I'm missing here?

  1.  
  2.  
  3. <!-- #includes file="DBConnect.inc" -->
  4.  
  5. <%
  6. u_CDNum=request.form("u_CDNum")
  7. u_CDDesc=request.form("u_CDDesc")
  8. u_CDStock=request.form("u_CDStock")
  9. %>
  10.  
  11. <%
  12. SQL = "INSERT INTO CDNumber (nCDNumber, tCDDescription, bStockorMiscImages)
  13. VALUES ('"&u_CDNum&"','"&u_CDDesc&"','"&u_CDStock&"')"
  14. conn.Execute(SQL)
  15. %>

Get's this:

Microsoft VBScript compilation error '800a0409'

Unterminated string constant

/rsd_image_library/X/input_text_to_db.asp, line 12

SQL = "INSERT INTO CDNumber (nCDNumber, tCDDescription, bStockorMiscImages)
---------------------------------------------------------------------------^
Last edited by vicshoup; Dec 19th, 2007 at 5:26 pm.
Reply With Quote Quick reply to this message  
Join Date: Dec 2007
Posts: 113
Reputation: hielo is on a distinguished road 
Solved Threads: 17
hielo hielo is offline Offline
Junior Poster

Re: ASP & VB and Unterminated String Constant

 
0
  #2
Dec 20th, 2007
You have the SQL statement in two
separate lines. VBScript is interpreting the end of line as the end of statement.
You can:
a. remove the new line character so that all in on a single line
  1. SQL = "INSERT INTO CDNumber (nCDNumber, tCDDescription, bStockorMiscImages) VALUES ('"&u_CDNum&"','"&u_CDDesc&"','"&u_CDStock&"')"
OR
b. append and underscore at the end of the first line so that when VBSCRIPT sees it, it knows the statent continues on the next line.
  1. SQL = "INSERT INTO CDNumber (nCDNumber, tCDDescription, bStockorMiscImages) _
  2. VALUES ('"&u_CDNum&"','"&u_CDDesc&"','"&u_CDStock&"')"
Reply With Quote Quick reply to this message  
Join Date: Dec 2007
Posts: 6
Reputation: vicshoup is an unknown quantity at this point 
Solved Threads: 0
vicshoup vicshoup is offline Offline
Newbie Poster

Re: ASP & VB and Unterminated String Constant

 
0
  #3
Dec 20th, 2007
D'oh, I was hoping it was something like that. I'd been looking at it too long to see very clear.

Thanks!
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC