A easy way to get data from MSAccess parameter query into ADO Recordset
A easy way to get data from MSAccess parameter query into ADO Recordset
Rate A easy way to get data from MSAccess parameter query into ADO Recordset
(3(3 Vote))
'
'Set reference to ADO library first.
'In my test, the parameter query will return all records in table PRODUCTS
'whoes ProductID <= the passed value. It looks like this:
'SELECT Products.* FROM Products WHERE (Products.ProductID<=IDMax);
'
Dim Cnn As New ADODB.Connection
Dim Rst As New ADODB.Recordset
'
'Open a Connection using an ODBC DSN.
Cnn.Open "DSN=adoobj;UID=;PWD=;"
'
'All records whose ProductID <= 3 will be returned.
Set Rst = Cnn.Execute("qry_storedproc 3", , adCmdStoredProc)
'
Do While Not Rst.EOF
Debug.Print Rst(0)
Rst.MoveNext
Loop
'
Set Rstc = Nothing
Set Cnn = Nothing
'
End Sub
A easy way to get data from MSAccess parameter query into ADO Recordset Comments
No comments yet — be the first to post one!
Post a Comment