Results 1 to 2 of 2

Thread: resolved run-time error 91

  1. #1

    Thread Starter
    New Member
    Join Date
    Mar 2002
    Posts
    7

    resolved run-time error 91

    i am trying to write a program for an estates agents. I have a table in access97 with the house details and i want to pick out certain houses. i am getting the run-time error 91 and dont know how to fix it.
    Last edited by minimarsh; Mar 7th, 2002 at 09:05 AM.

  2. #2
    Guru Aaron Young's Avatar
    Join Date
    Jun 1999
    Location
    Red Wing, MN, USA
    Posts
    2,177
    The Object variable or With block variable not set error could be caused by not creating an instance of the object you're referring to, i.e.
    VB Code:
    1. Dim oRs As ADODB.Recordset
    2.  
    3.     oRs.Open "SomeTable", "DSN=MYDSN;"
    Would fail.
    VB Code:
    1. Dim oRs As New ADODB.Recordset
    2.  
    3.     oRs.Open "SomeTable", "DSN=MYDSN;"
    Or
    VB Code:
    1. Dim oRs As ADODB.Recordset
    2.  
    3.     Set oRs = New ADODB.Recordset
    4.  
    5.     oRs.Open "SomeTable", "DSN=MYDSN;"
    Would Work.

Posting Permissions

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



Click Here to Expand Forum to Full Width