Results 1 to 2 of 2
  1. #1
    Join Date
    Apr 2003
    Posts
    114

    Unanswered: Object or With Block...

    Any idea why this would generate the notorious "Object of With Block variable not set"? Right now the IndResults table has no records in it but this error usually results from not using the 'Set' key word or already closing a block and then trying to re-use it. This code is being called from within a function.

    Set rs = New ADODB.Recordset
    rs.Open "SELECT PartID FROM IndResults WHERE PartID = " & lPartID, conn, adOpenStatic, adLockOptimistic

    Thanks!!

  2. #2
    Join Date
    Feb 2003
    Location
    Montreal, Canada
    Posts
    117

    Re: Object or With Block...

    Is your connection set and opened when you attempt to open the recordset?


    Originally posted by Bobba Buoy
    Any idea why this would generate the notorious "Object of With Block variable not set"? Right now the IndResults table has no records in it but this error usually results from not using the 'Set' key word or already closing a block and then trying to re-use it. This code is being called from within a function.

    Set rs = New ADODB.Recordset
    rs.Open "SELECT PartID FROM IndResults WHERE PartID = " & lPartID, conn, adOpenStatic, adLockOptimistic

    Thanks!!
    Steve

Posting Permissions

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