PDA

View Full Version : Error when searching


malhyp
09-05-2005, 10:38 AM
Heya all. This forum is great. I wish I knew it was here months ago.

Can anyone help with the following error?

------------------------------------------------------------
Microsoft VBScript compilation error '800a0400'
Expected statement
/html/results.asp, line 21
Option Explicit
------------------------------------------------------------

This error comes up when I click the submit button in a search page which is supposed to direct to the results page. I have also included some script below.

1 <%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
2 <!--#include file="../Connections/connTimberseek.asp" -->
3 <%
4 Dim Recordset1
5 Dim Recordset1_numRows
6 Set Recordset1 = Server.CreateObject("ADODB.Recordset")
7 Recordset1.ActiveConnection = MM_connTimberseek_STRING
8 Recordset1.Source = "SELECT * FROM Suppliers"
9 Recordset1.CursorType = 0
10 Recordset1.CursorLocation = 2
11 Recordset1.LockType = 1
12 Recordset1.Open()
13 Recordset1_numRows = 0
14 %>
15 <%
16 Dim Repeat1__numRows
17 Dim Repeat1__index
18 Repeat1__numRows = 3
19 Repeat1__index = 0
20 Recordset1_numRows = Recordset1_numRows + Repeat1__numRows
21 %>
22 <% Option Explicit %>
23 <html>
24 <head>
25 <title>Search The Timberseek Network</title>
26 <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
27 <script language="JavaScript" type="text/JavaScript">
28 <!--

Thanks to all.
Mal R.

ranjan
09-05-2005, 03:30 PM
22 <% Option Explicit %>

The above statement whenever used should always be the second line after

<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>

whenever used

Why are you using option explicit?

http://msdn.microsoft.com/library/default....ionexplicit.asp ('http://msdn.microsoft.com/library/default.asp?url=/library/en-us/script56/html/vsstmoptionexplicit.asp')

malhyp
09-06-2005, 09:12 AM
Ranjan, thanks for the reply. I gave it a go and it worked better. It actualy came up with another error, but one that I could understand. Thank you for your support.

Malcolm R.