0

Can someone take a look at this and possibly tell me what I'm missing here?

<!-- #includes file="DBConnect.inc" -->

<% 
	u_CDNum=request.form("u_CDNum")
	u_CDDesc=request.form("u_CDDesc")
	u_CDStock=request.form("u_CDStock")
%>

<%
SQL = "INSERT INTO CDNumber (nCDNumber, tCDDescription, bStockorMiscImages) 
VALUES ('"&u_CDNum&"','"&u_CDDesc&"','"&u_CDStock&"')"
conn.Execute(SQL)
%>

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)
---------------------------------------------------------------------------^

2
Contributors
2
Replies
3
Views
9 Years
Discussion Span
Last Post by vicshoup
0

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&"')"
0

D'oh, I was hoping it was something like that. I'd been looking at it too long to see very clear.

Thanks!

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.