[thelist] help: Object required

Dena teke at pullman.com
Wed May 25 12:36:49 CDT 2005

the connection code had some extra lines in it.  unfortunately, they
aren't the problem.  when this code is inserted directly in the page there
is no error.  the code below works.  it's just when the connection is in a
sub that there is an error.

<% Option Explicit %>
<% response.buffer=TRUE %><%

'sub subOpenDBConn()
		dim Path, Connection, dbConn
		Path = Server.MapPath ("/datastore/library.mdb")
		'Response.Write Path
  	Set Connection = Server.CreateObject("ADODB.Connection")
		dbConn = "Provider=Microsoft.Jet.OLEDB.4.0;" &_
				"Data Source = "&Path&";" &_
				"Persist Security Info = FALSE"
		Connection.Open dbConn
		'end sub

dim iDocId: iDocId="":if request("iDocId")<>"" then iDocId=request("iDocId")
if len(iDocId)>0 then 'doc id has a value
	 dim sDocQuery: sDocQuery="SELECT doc_checkedout, doc_title, doc_callno,
doc_location from lib_document where doc_seq = " & iDocId & ";"
	 'call subOpenDBConn()
	 'dim connection
	 dim rsDoc
	 set rsDoc=connection.Execute(sDocQuery) 'line 19
end if

>>-----Original Message-----
>>From: thelist-bounces at lists.evolt.org
>>[mailto:thelist-bounces at lists.evolt.org]On Behalf Of Brian Cummiskey
>>Sent: Wednesday, May 25, 2005 10:18 AM
>>To: thelist at lists.evolt.org
>>Subject: Re: [thelist] help: Object required
>>Dena wrote:
>>>     Path = Server.MapPath ("/datastore/library.mdb")
>>> Object required: ''
>>object required errors means that it can't find the called stored
>>procedure or database in this case.  check that your path is correct and
>>that the webserver has permission to access said path.
>>* * Please support the community that supports you.  * *
>>For unsubscribe and other options, including the Tip Harvester
>>and archives of thelist go to: http://lists.evolt.org
>>Workers of the Web, evolt !

More information about the thelist mailing list