VB Code:
Private Sub Command1_Click() Dim results As ADODB.Recordset Set results = New ADODB.Recordset ' Create new Recordset If Not (results.BOF Or results.EOF) Then MsgBox results.Fields.Count End If End Sub
Why doesn't the above code work? It gives me an run-time error "operation not allowed when object is closed". However if I add a field to the recordset then it works. I need to create an EMPTY recordset for a function. Whats the problem here?




Reply With Quote