Wrox Programmer Forums
|
Classic ASP Databases Discuss using ASP 3 to work with data in databases, including ASP Database Setup issues from the old P2P forum on this specific subtopic. See also the book forum Beginning ASP.NET Databases for questions specific to that book. 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 Databases 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 December 22nd, 2004, 11:55 AM
Registered User
 
Join Date: Dec 2004
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default Microsoft VBScript compilation error

I am new to aspnewbie, could someone please help me...I keep getting these errors: any assistance rendereed would be greatly appreciated


Microsoft VBScript compilation error '800a0411'

Name redefined

/Home/Database/search.asp, line 16

Const adOpenForwardOnly = 0
------^






Microsoft VBScript compilation error '800a03f3'

Expected '='

/Home/Database/search.asp, line 26

Set objConn Server.CreateObject("ADOB.Connection")

------------^



here is my code for my database:


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>

<meta type =typelib"
            file = C:\Program Files\Common Files\System\ado\msado15.dll"-->
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Search Document Database</title>
</head>

<body>

<%
Dim adOpenForwardOnly, adLockReadOnly, adCmdtable
Const adOpenForwardOnly = 0 (this is line sixteen)Const adLockReadOnly = 1
Const adCmdTable = 2
Const adOpenstatic = 3

Dim strSearch, strCriteria
strSearch = Request.Form ("search")

Dim objConn, objRS

Set objConn Server.CreateObject("ADOB.Connection") (this is line 26)
Set objRs = Server.CreateObject("ADODB.Recordset")
objConn.Open strConnect
objRS.Open "Document", objConn, adOpenstatic, adLockReadOnly, adCmdTable
strDescription= "Document'" & strSearch & "'"

objRs.Find.strCriteria 'show first relevant record
If objRS.EOF Then
Response.Write("Sorry the serach words use did not generate any records. Please try again using different search words")

Else
Response.Write "Your search genererated the following documents" & "strSearch"
Response.Write objRS("Subject")
Response.Write objRS("Description")
End If
objRs.Close
Set objRs = Nothing
%>


</body>
</html>



 
Old December 22nd, 2004, 01:24 PM
Friend of Wrox
 
Join Date: Jul 2003
Posts: 683
Thanks: 0
Thanked 1 Time in 1 Post
Default

Hi,

The statements Dim & Const both declare variables, so you need to lose the line:
Code:
Dim adOpenForwardOnly, adLockReadOnly, adCmdtable
and
Code:
Set objConn Server.CreateObject("ADOB.Connection")
should be
Code:
Set objConn = Server.CreateObject("ADOB.Connection")
HTH,

Chris

 
Old December 29th, 2004, 10:44 AM
Registered User
 
Join Date: Dec 2004
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default

thanks...solve one got another...solved one got another....very cyclic:D






Similar Threads
Thread Thread Starter Forum Replies Last Post
Microsoft VBScript compilation error '800a03f6' jdutwell Classic ASP Basics 3 April 2nd, 2008 01:50 PM
Microsoft VBScript compilation error '800a03f6' ksrhyd Classic ASP Professional 0 October 11th, 2007 07:53 AM
Microsoft VBScript compilation error '800a0408' tarzannn Classic ASP Professional 2 February 3rd, 2006 08:55 AM
Microsoft VBScript compilation error '800a0401' baistopgun BOOK: Beginning ASP 3.0 3 October 16th, 2004 12:52 PM





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