Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 679
  • Last Modified:

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

<%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
beeravally
Asked:
beeravally
  • 2
3 Solutions
 
Carl TawnSystems and Integration DeveloperCommented:
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
 
nurbekCommented:
try this (forgotten & " before and)

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

0
 
nurbekCommented:
myStr = "Select * from vwLastScanPoint where ID =" & VehicleID & " AND Scanpoint not in ('6')"
0
 
Faheem ShaikhCommented:
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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now