?
Solved

i have found the error type Microsoft VBScript compilation (0x800A0409) Unterminated string constant ,pls find the erro in my code.

Posted on 2005-04-04
4
Medium Priority
?
669 Views
Last Modified: 2012-06-27
<%Option Explicit%>
<html>
<%
Dim GoFlag,VehicleID,myStr,myInstr
dim dc1, strSQL, ScanPoint
%>
<head>
<META name=VI60_defaultClientScript content=VBScript>
<meta NAME="GENERATOR" Content="Microsoft Visual Studio 6.0">

<!-- #include file="includes/connInfo.inc" -->
<!-- #include file="includes/DrawTbl.inc" -->

<title>DTS System</title>
<link REL="stylesheet" TYPE="text/css" HREF="_Themes/indust/THEME.CSS" VI6.0THEME="Industrial">
<link REL="stylesheet" TYPE="text/css" HREF="_Themes/indust/GRAPH0.CSS" VI6.0THEME="Industrial">
<link REL="stylesheet" TYPE="text/css" HREF="_Themes/indust/COLOR0.CSS" VI6.0THEME="Industrial">
<link REL="stylesheet" TYPE="text/css" HREF="_Themes/indust/CUSTOM.CSS" VI6.0THEME="Industrial">
</head>
<body>
<SCRIPT LANGUAGE=vbscript>
<!--
sub window_onload()
      form1.txtInstr.focus
end sub

function form1_onsubmit()
      if form1.txtInstr.value = "" then
            msgbox "Please enter transport instructions before submitting.",16,"No Instructions"
            form1_onsubmit = FALSE
      end if
end function
//-->
</SCRIPT>
<form action=Instructions3.asp id=form1 name=form1>
<TABLE WIDTH="80%" ALIGN=center BORDER=1 CELLSPACING=1 CELLPADDING=1>
<TR>
      <TD align=middle bgcolor="midnightblue" style="HEIGHT: 50px" colSpan=2>
      <FONT Face=Arial size=5 color=white>
      Capture Transport Instructions</FONT>
      </TD>
</TR>
<TR>
      <TD align=right>
      <FONT Face=Arial size=4>
      Vehicle Serial No.:
      </FONT>
      </TD>
      <TD align=middle>
      <FONT Face=Arial size=4 color=blue>
      <%=session("serialno")%>
      <%
'--- Check if vehicle is at a valid scanpoint.
      GoFlag = VerifySP()
%>&nbsp;&nbsp;
      </FONT>
      </TD>
</TR>
<%if GoFlag = "OK"  then%>
<TR>
      <TD align=right>
            <FONT Face=Arial size=4>Customer:</FONT>
      </TD>
      <TD align=middle>
      <FONT Face=Arial size=4>
      <%
      strSQL = "SELECT CustName from vwCustvehDetails WHERE ID = "& VehicleID
      %>
      <%=GetValueFromSelect("CustName",strSQL)%>
      </TD>
</TR>
<TR>
      <TD align=right>
      <FONT Face=Arial size=4>
      Current scanpoint:</FONT>
      </TD>
      <TD align=middle>
      <FONT Face=Arial size=4>
        <%      
      strSQL = "SELECT Scanpoint + ' - ' + ScanpointDesc As SpAndDesc FROM tblScanpoint " _
                  & "WHERE Scanpoint = '" & session("Scanpoint") & "'"
      %>
      <%=GetValueFromSelect("SpAndDesc",strSQL)%>
      </FONT>
      </TD>
</TR>
<TR>
      <TD align=middle colSpan=2>
      <FONT Face=Arial size=4>
      Enter Special Instructions</FONT>
      </TD>
</TR>
<tr>
<td colspan=2 align=middle>
      <FONT Face=Arial size=4>
      <TEXTAREA rows=4 cols=50 id=txtInstr name=txtInstr style="align:center"><%=myInstr%></TEXTAREA>
      </FONT>
</td>
</tr>
<TR>
      <td colSpan=2 align=middle bgcolor="midnightblue" style="HEIGHT: 50px">
      <INPUT id=submit name=submit type=submit value=Submit height="32" style="HEIGHT: 25px; WIDTH: 100px">
      &nbsp;
      <INPUT id=reset name=reset type=reset value=Reset height="32" style="HEIGHT: 25px; WIDTH: 100px" onclick="window.location='Instructions1.asp'">
      </td>
</TR>
<%Else%>
<TR>
<TD align=center colspan=2>
<Font Face=Arial size=4 color=red>
Cannot enter Transport Instructions for the serial number entered.<BR>Please click the vehicle detail link and check the location of the vehicle.<BR>
<A href='ViewVehicle.asp'>Vehicle Detail</Font></A>
</Font>
</TD>
</TR>
<TR>
<TD colspan=2 bgcolor=midnightblue style="Height: 50px" align=middle>
<INPUT Id=ReCapture name=ReCapture type=button style="Height: 25px;Width: 100px" value=Recapture onclick="window.location='Instructions1.asp'">
</TD>
</TR>
<%End If%>
</TABLE>
</form>
</body>
</html>
<%
Function VerifySP()
      set Conn = Server.CreateObject("ADODB.Connection")
      Conn.Open session("connStr")
'Get vehicle LotID
      VehicleID = GetLotID (session("serialno"))
      session("LotID") = VehicleID
      myStr = "Select * from vwLastScanPoint where ID =" & VehicleID AND " _
            & "Scanpoint not in ('6')"
'Response.Write mystr
      set rs = Conn.Execute(myStr)
      if rs.eof = true then
            VerifySP = "NO"
      Else
            VerifySP = "OK"
            session("Scanpoint") = trim(rs("Scanpoint"))
      End if
      rs.close
'--- Check if there is already an instruction at this scanpoint
'      myStr = "Select * from tblInstructions where SerialNo = " & VehicleID & " AND " _
'            & "InstructFromSP = '" & session("Scanpoint") & "'"
      myStr = "Select * from tblInstructions where SerialNo = " & VehicleID
      set rs = Conn.Execute(myStr)
      if not rs.eof then
            myInstr = trim(rs("Instruction"))
      End if
End function
%>
0
Comment
Question by:beeravally
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 52

Assisted Solution

by:Carl Tawn
Carl Tawn earned 300 total points
ID: 13696573
This line:

     myStr = "Select * from vwLastScanPoint where ID =" & VehicleID AND " _
          & "Scanpoint not in ('6')"

Needs to be:

     myStr = "Select * from vwLastScanPoint where ID =" & VehicleID & " AND " _
          & "Scanpoint not in ('6')"
0
 
LVL 13

Expert Comment

by:nurbek
ID: 13696594
try this (forgotten & " before and)

     myStr = "Select * from vwLastScanPoint where ID =" & VehicleID & " AND " _
          & "Scanpoint not in ('6')"

0
 
LVL 13

Accepted Solution

by:
nurbek earned 900 total points
ID: 13696600
myStr = "Select * from vwLastScanPoint where ID =" & VehicleID & " AND Scanpoint not in ('6')"
0
 
LVL 8

Assisted Solution

by:Faheem Shaikh
Faheem Shaikh earned 300 total points
ID: 13698496
If the previous comments are not solving your problem then instead of this::
                         Dim GoFlag,VehicleID,myStr,myInstr
                         dim dc1, strSQL, ScanPoint
           
           Do this:: Dim GoFlag, VehicleID, myStr, myInstr
                        dim dc1, strSQL, ScanPoint
Even this does'nt work then try declaring all the variables one by one individually.
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I have helped a lot of people on EE with their coding sources and have enjoyed near about every minute of it. Sometimes it can get a little tedious but it is always a challenge and the one thing that I always say is:   The Exchange of informatio…
This demonstration started out as a follow up to some recently posted questions on the subject of logging in: http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/Q_28634665.html and http://www.experts-exchange.com/Programming/…
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…

741 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question