Return recordset with adp connection

ezfriend

Registered User.
Local time
Today, 09:56
Joined
Nov 24, 2006
Messages
242
How can I return a recordset using adp.connection

my recordset is "SELECT * FROM vwCustomderDat WHERE CustID = 223234 "

Code:
Private Sub Process()

    Dim rs As ADODB.Recordset
    Dim sSQL As String
    Dim sVals As String
    
    Set rs = New ADODB.Recordset

    sVals = ""
    sSQL = ""
    sSQL = sSQL & "SELECT * FROM vwCustomderDat "
    sSQL = sSQL & "WHERE CustID= " & Me.oid
    rs.Open sSQL, CurrentProject.Connection

    '...........

End Sub

I get an error at rs.Open sSQL, CurrentProject.Connection
 
Hi.
What error do you get exactly?
Such detail is vital.

Is the form bound (and the application's connection active)?
The form that contains this criteria has a different source than vwCustomderDat I presume? (Otherwise why open the subsequent recordset to the same source? ;-)
 

Users who are viewing this thread

Back
Top Bottom