Wrox Programmer Forums
|
Classic ASP Basics For beginner programmers starting with "classic" ASP 3, pre-".NET." NOT for ASP.NET 1.0, 1.1, or 2.0
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old May 27th, 2007, 02:06 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 518
Thanks: 0
Thanked 0 Times in 0 Posts
Default Unterminated string constant error

I am using following query/code to retrieve the record.


rs.Open "select safetyvideo2007.user_id USER3 ,safetyvideoview.user_id USER2,safetyvideoview.name,safetyvideo2007.vdate,s afetyvideo2007.video1,safetyvideo2007.video2,....
..
to safetyvidwo2007.video44.....

We have to retrived 44 video records
it give folloiwng error message

Error Type:
Microsoft VBScript compilation (0x800A0409)
Unterminated string constant
/DCILDepts/Administration/Safety2007/newuserrecall2007.asp, line 284, column 1021

line 284 column 1021 it move to next line.
from column 1021, we could not write the query.

some other way we can write the long query in two parts ?
and use in loop

do while rs.eof=false
...

regards
Mateen







 
Old May 28th, 2007, 09:55 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 344
Thanks: 0
Thanked 1 Time in 1 Post
Default

Can you post the complete section of code for review ? can you also try running the query in Query Analyser and let us know if it works in there ? You can also assign your Query into a String and then use that as follows :

mySQL="SELECT hello FROM world"

rs.Open mySQL
 
Old May 30th, 2007, 02:36 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 518
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks for response.
query running fine in sql query nanlyser.

code is following

<HTML>
<HEAD>
</HEAD>
<BODY>
<%

user_id=Request.QueryString("user_id")

vdate=date()
        
video1=Request.Form("checkbox1")
video2=Request.Form("checkbox2")
video3=Request.Form("checkbox3")
video4=Request.Form("checkbox4")
video5=Request.Form("checkbox5")
video6=Request.Form("checkbox6")
video7=Request.Form("checkbox7")
video8=Request.Form("checkbox8")
video9=Request.Form("checkbox9")
video10=Request.Form("checkbox10")
video11=Request.Form("checkbox11")
video12=Request.Form("checkbox12")
video13=Request.Form("checkbox13")
video14=Request.Form("checkbox14")
video15=Request.Form("checkbox15")
video16=Request.Form("checkbox16")
video17=Request.Form("checkbox17")
video18=Request.Form("checkbox18")
video19=Request.Form("checkbox19")
video20=Request.Form("checkbox20")
video21=Request.Form("checkbox21")
video22=Request.Form("checkbox22")
video23=Request.Form("checkbox23")
video24=Request.Form("checkbox24")
video25=Request.Form("checkbox25")
video26=Request.Form("checkbox26")
video27=Request.Form("checkbox27")
video28=Request.Form("checkbox28")
video29=Request.Form("checkbox29")
video30=Request.Form("checkbox30")
video31=Request.Form("checkbox31")
video32=Request.Form("checkbox32")
video33=Request.Form("checkbox33")
video34=Request.Form("checkbox34")
video35=Request.Form("checkbox35")
video36=Request.Form("checkbox36")
video37=Request.Form("checkbox37")
video38=Request.Form("checkbox38")
video39=Request.Form("checkbox39")
video40=Request.Form("checkbox40")
video41=Request.Form("checkbox41")
video42=Request.Form("checkbox42")
video43=Request.Form("checkbox43")
video44=Request.Form("checkbox44")


set cn=server.CreateObject("adodb.connection")
cn.ConnectionString=" // connection string "
cn.Open

isql1="insert into safetyvideo2007(user_id,vdate,video1,video2,video3 ,video4,video5,video6,video7,video8,video9,video10 ,video11,video12,video13,video14,video15,video16,v ideo17,video18,video19,video20,video21,video22,vid eo23,video24,video25,video26,video27,video28,video 29,video30,video31,video32,video33,video34,video35 ,video36,video37,video38,video39,video40,video41,v ideo42,video43,video44) values ("
isql2="'" & user_id & "',"
isql3="'" & vdate & "',"
isql4="'" & video1 & "',"
isql5="'" & video2 & "',"
isql6="'" & video3 & "',"
isql7="'" & video4 & "',"
isql8="'" & video5 & "',"
isql9="'" & video6 & "',"
isql10="'" & video7 & "',"
isql11="'" & video8 & "',"
isql12="'" & video9 & "',"
isql13="'" & video10 & "',"
isql14="'" & video11 & "',"
isql15="'" & video12 & "',"
isql16="'" & video13 & "',"
isql17="'" & video14 & "',"
isql18="'" & video15 & "',"
isql19="'" & video16 & "',"
isql20="'" & video17 & "',"
isql21="'" & video18 & "',"
isql22="'" & video19 & "',"
isql23="'" & video20 & "',"
isql24="'" & video21 & "',"
isql25="'" & video22 & "',"
isql26="'" & video23 & "',"
isql27="'" & video24 & "',"
isql28="'" & video25 & "',"
isql29="'" & video26 & "',"
isql30="'" & video27 & "',"
isql31="'" & video28 & "',"
isql32="'" & video29 & "',"
isql33="'" & video30 & "',"
isql34="'" & video31 & "',"
isql35="'" & video32 & "',"
isql36="'" & video33 & "',"
isql37="'" & video34 & "',"
isql38="'" & video35 & "',"
isql39="'" & video36 & "',"
isql40="'" & video37 & "',"
isql41="'" & video38 & "',"
isql42="'" & video39 & "',"
isql43="'" & video40 & "',"
isql44="'" & video41 & "',"
isql45="'" & video42 & "',"
isql46="'" & video43 & "',"
isql47="'" & video44 & "')"

sql=isql1+isql2+isql3+isql4+isql5+isql6+isql7+isql 8+isql9+isql10+isql11+isql12+isql13+isql14+isql15+ isql16+isql17+isql18+isql19+isql20+isql21+isql22+i sql23+isql24+isql25+isql26+isql27+isql28+isql29+is ql30+isql31+isql32+isql33+isql34+isql35+isql36+isq l37+isql38+isql39+isql40+isql41+isql42+isql43+isql 44+isql45+isql46+isql47

on error resume next

cn.Execute sql line 284, column 1021


if err.number=0 then
Response.Redirect("http://dcilweb/DCILDepts/Administration/safety2007/save.asp")
else
Response.Redirect("http://dcilweb/DCILDepts/Administration/safety2007/wrong.asp")
end if

%>
<P>&nbsp;</P>
</BODY>
</HTML>





Similar Threads
Thread Thread Starter Forum Replies Last Post
Unterminated string constant cnottingham Classic ASP Databases 8 October 28th, 2011 01:43 PM
Unterminated String constant byge0rg Javascript 1 February 11th, 2007 09:45 PM
unterminated string constant crmpicco Javascript How-To 2 February 7th, 2005 12:10 PM
unterminated string constant Stubby HTML Code Clinic 1 February 3rd, 2005 05:56 AM
unterminated string constant mariakovacs Classic ASP Basics 3 January 26th, 2004 03:59 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.