[thelist] help: Object required

Dena teke at pullman.com
Wed May 25 12:08:52 CDT 2005


Hey,

Why do I get "object required" error when I call this subroutine?
I've looked through microsoft info and googled the problem, and it
should work.

sub subOpenDBConn()
    dim oConn, Path, dbConn, conntemp
    Path = Server.MapPath ("/datastore/library.mdb")
    Set oConn = Server.CreateObject("ADODB.Connection")
    dbConn = "Provider=Microsoft.Jet.OLEDB.4.0;" &_
         "Data Source = "&Path&";" &_
         "Persist Security Info = FALSE"
    oConn.Open dbConn
    set conntemp=server.createobject("adodb.connection")
    conntemp.open oConn
end sub

here's the page that calls the sub

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

if len(iDocId)>0 then 'doc id has a value
  call subOpenDBConn()
  dim conntemp
  dim sDocQuery
  sDocQuery="SELECT doc_checkedout, doc_title, doc_callno where doc_seq = "
& iDocId & ";"
  dim rsDoc: set rsDoc=conntemp.execute(sDocQuery) 'this lines gives the
error
end if %>

the error points to the last line above
Microsoft VBScript runtime (0x800A01A8)
Object required: ''





More information about the thelist mailing list