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.