User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the ASP section within the Web Development category of DaniWeb, a massive community of 397,526 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 3,671 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our ASP advertiser: Lunarpages ASP Web Hosting
Views: 1262 | Replies: 2
Reply
Join Date: Dec 2007
Posts: 6
Reputation: vicshoup is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
vicshoup vicshoup is offline Offline
Newbie Poster

Help ASP & VB and Unterminated String Constant

  #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 4:26 pm.
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Dec 2007
Posts: 75
Reputation: hielo is an unknown quantity at this point 
Rep Power: 1
Solved Threads: 10
hielo hielo is offline Offline
Junior Poster in Training

Re: ASP & VB and Unterminated String Constant

  #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
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.
SQL = "INSERT INTO CDNumber (nCDNumber, tCDDescription, bStockorMiscImages) _
VALUES ('"&u_CDNum&"','"&u_CDDesc&"','"&u_CDStock&"')"
Reply With Quote  
Join Date: Dec 2007
Posts: 6
Reputation: vicshoup is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
vicshoup vicshoup is offline Offline
Newbie Poster

Re: ASP & VB and Unterminated String Constant

  #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  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

DaniWeb ASP Marketplace
Thread Tools Display Modes

Other Threads in the ASP Forum

All times are GMT -4. The time now is 2:34 pm.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC