| | |
ASP & VB and Unterminated String Constant
Please support our ASP advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
![]() |
•
•
Join Date: Dec 2007
Posts: 6
Reputation:
Solved Threads: 0
Can someone take a look at this and possibly tell me what I'm missing here?
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)
---------------------------------------------------------------------------^
ASP Syntax (Toggle Plain Text)
<!-- #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)
---------------------------------------------------------------------------^
Last edited by vicshoup; Dec 19th, 2007 at 5:26 pm.
•
•
Join Date: Dec 2007
Posts: 113
Reputation:
Solved Threads: 17
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
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.
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
ASP Syntax (Toggle Plain Text)
SQL = "INSERT INTO CDNumber (nCDNumber, tCDDescription, bStockorMiscImages) VALUES ('"&u_CDNum&"','"&u_CDDesc&"','"&u_CDStock&"')"
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.
ASP Syntax (Toggle Plain Text)
SQL = "INSERT INTO CDNumber (nCDNumber, tCDDescription, bStockorMiscImages) _ VALUES ('"&u_CDNum&"','"&u_CDDesc&"','"&u_CDStock&"')"
![]() |
Other Threads in the ASP Forum
- Previous Thread: Select from a 2-dimensional array
- Next Thread: Is there a way to separate strings in Classic ASP
| Thread Tools | Search this Thread |
archive asp asp.net aspandmssqlserver2005 aspandmssqlserver2005connection aspconnection connection database databaseconnection dreamweaver excel fso iis msmsql mssql2005 mssqlserver2005 mssqlserver2005andasp mssqlserverandasp opentextfile record searchbox selectoption single specfic sqlserver sqlserverconnection windows7





