Object Required error

Results 1 to 2 of 2

Thread: Object Required error

  1. #1
    Join Date
    Dec 1969

    Default Object Required error

    I am getting the following error when i refer to my recordset variable:<BR><BR>Microsoft VBScript runtime error &#039;800a01a8&#039; <BR>Object required: &#039;&#039; <BR><BR>I know it has to do with something in my "connect to databse code" but i am not to sure why, cos i have used it before in some of my other code and it seems to work fine :<BR><BR> &#060;%<BR>Function SearchDatabaseForInfo()<BR> Const adUseClient = 3<BR> Const adOpenStatic = 3<BR> Const adLockReadOnly = 1<BR> Const adCmdText = &H0001<BR><BR> Dim cnnTemp, rstTemp<BR> <BR> &#039; Connect to our DB<BR> Set cnnTemp = Server.CreateObject("ADODB.Connection")<BR> cnnTemp.Open "Provider=SQLOLEDB.1;Data Source=Yellowjacket;Database=beesIntranet;UID=sa;P WD=;"<BR> <BR> &#039; Create a RS that we can disconnect<BR> Set rstTemp = Server.CreateObject("ADODB.Recordset")<BR> rstTemp.CursorLocation = adUseClient<BR> Set rstTemp.ActiveConnection = cnnTemp<BR> <BR> &#039; Get the data... this is where you could change the<BR> &#039; sort order if you wanted to.<BR> rstTemp.Open "SELECT * FROM suppliers ORDER BY name DESC"&#039; _<BR> &#039;, , adOpenStatic, adLockReadOnly, adCmdText<BR><BR> &#039; Diconnect <BR> Set rstTemp.ActiveConnection = Nothing<BR> <BR> &#039; Close and dispose of our connection<BR> cnnTemp.Close<BR> Set cnnTemp = Nothing<BR><BR> &#039; Set the RS as the functions return value<BR> &#039;Set GetInfoFromDB = rstTemp<BR>End Function<BR>%&#062;<BR><BR>thanx <BR><BR>

  2. #2
    Join Date
    Dec 1969

    Default RE: Object Required error

    Where does the error occur? <BR><BR>Function SearchDatabaseForInfo()<BR>&#039;Set GetInfoFromDB = rstTemp<BR><BR>Even if you remove the comment introducer, you should use the function name in the assignment.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts