Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

unterminated string constant error

Status
Not open for further replies.

amisima

Programmer
Jun 11, 2003
13
0
0
CA
Hi,
I am getting the error "unterminated string constant".
I have an input box. When I type "affected party" and press submit. The submit button calls an insert function and it inserts into an Oracle database. This all works fine.
When I copy and paste "affected party" from a word document into the input box and press, submit I get the "unterminated string constant" error. I think the problem is the word document has a carriage return after the "affected" and then "party" follows the carriage return. I think the carriage return is cause the error. I am not sure how to go about fixing this problem.

Can anyone help?

Thanks,

Amisima
 
This shoulds like an VBScript error not an SQL Sintax error.
Try to post the code.

________
George, M
 
Here is the input box I am using.
variant_array = PopulateRS(strSQL, db_CATS)

response.write &quot;var pane2 = &quot;&quot;<table border=0 bgcolor = #e7e4d6 width = '67%' height = '100%'>&quot;
if isarray(variant_array) Then
for i = 0 to ubound(variant_array, 2)
response.write &quot;<tr><td align = right>Var:<textarea COLS='30' ROWS='3' NAME='variant__&quot; & i & &quot;'>&quot; & variant_array(2, i) & &quot;</textarea>&quot;
response.write &quot;<tr><td align = right>S:<textarea COLS='30' ROWS='3' NAME='variant_source_&quot; & i & &quot;'>&quot; & variant_array(3, i) & &quot;</textarea>&quot;
next
response.write &quot;<tr><td>&nbsp;</td></tr>&quot;
for i = 2000 to 2002
response.write &quot;<tr><td align = right>Var:<textarea COLS='30' ROWS='3' NAME='variant__&quot; & i & &quot;'></textarea>&quot;
response.write &quot;<tr><td align = right>S:<textarea COLS='30' ROWS='3' NAME='variant_source_&quot; & i & &quot;'></textarea>&quot;
next
else
for i = 0 to 2
response.write &quot;<tr><td align = right>Var:<textarea COLS='30' ROWS='3' NAME='variant__&quot; & i & &quot;'></textarea>&quot;
response.write &quot;<tr><td align = right>S:<textarea COLS='30' ROWS='3' NAME='variant_source_&quot; & i & &quot;'></textarea>&quot;
next
end if

 
This line i see has an string error.
The others looks ok.
Code:
response.write &quot;var pane2 =  &quot;&quot;<table border=0 bgcolor = #e7e4d6 width = '67%' height = '100%'>&quot;
try this way.

response.write &quot;var pane2 =  &quot;&quot;<table border=0 bgcolor = #e7e4d6 width = '67%' height = '100%'>&quot;&quot;&quot;

but you can do even easyer if you want to combine ASP script with Client side Script


<%
'asp code here
%>
var pane2=&quot;<table border=0 bgcolor = #e7e4d6 width = '67%' height = '100%'>&quot;
<%
'asp code here
%>

your response.write &quot;var pane2 =  &quot;&quot;<table border=0 bgcolor = #e7e4d6 width = '67%' height = '100%'>&quot;&quot;&quot;

would go to

%>
var pane2=&quot;<table border=0 bgcolor = #e7e4d6 width = '67%' height = '100%'>&quot;
<%

________
George, M
 
Looks like a variable in Client Javascript.
Both sugestions are ok.

________
George, M
 
I have found it helpful to start Netscape and run javascript: from the address line after I have a problem. Try it to see if you get a more specific error. Does anyone know a good way of getting error debugging with IE?
 
Tools->Internet Option->Advanced tab->Uncheck &quot;Disable Error Debugging&quot;

________
George, M
 
I am a similar situation to the above question. I copied some code from another page that works, no bugs, no problems, just returns. Now that same code (modified for different table and field names) gives me an &quot;unterminated string constant&quot; for a ' ... I'm confused.

<%
If request.form(&quot;FT&quot;)=&quot;key&quot; then
SQLsrc = &quot;SELECT * FROM history WHERE &quot;
SQLsrc = SQLsrc & &quot;((history.Year) Like '%&quot; & request.form(&quot;Year&quot;) & &quot;%') <--- It doesn't like the last '
end if
%>

(line# & Column#s error info is great)
 
Maybe it should be like
SQLsrc = SQLsrc & &quot;((history.Year) Like '%&quot; & request.form(&quot;Year&quot;) & &quot;%')&quot;


________
George, M
 
If that was a poisonous snake I'd be dead now. Thanks for pointing out my blinding... err just blindness.

Thanks!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top