Concise code to populate ADO recordset from MSAccess query with multiple parameters
Concise code to populate ADO recordset from MSAccess query with multiple parameters
Rate Concise code to populate ADO recordset from MSAccess query with multiple parameters
(2(2 Vote))
'In my test, the parameter query in MSAccess looks like this (for testing purpose only):
'SELECT Titles.Title, Titles.[Year Published], Titles.PubID, Publishers.Name, 'Publishers.State
'FROM Publishers INNER JOIN Titles ON Publishers.PubID = Titles.PubID
'WHERE (((Titles.[Year Published])>=[SatartDate] And (Titles.[Year 'Published])<=[EndDate])
'AND ((Publishers.State)=[StateParam]) AND '((Publishers.PubID)<=[PubIDParam]));
'
'
Dim Cnn As New ADODB.Connection
Dim Rst As New ADODB.Recordset
'
'Open a Connection using an ODBC DSN. You can not use Jet OLEDB Provider here.
Cnn.Open "DSN=adoobj;UID=;PWD=;"
'
Set Rst = Cnn.Execute("Qry_MultiPrm #1/1/98#, #12/12/00#, 'MA', 8", , mdStoredProc)
'
Do While Not Rst.EOF
Debug.Print Rst(0)
Rst.MoveNext
Loop
Set Rst = Nothing
Set Cnn = Nothing
'
Concise code to populate ADO recordset from MSAccess query with multiple parameters Comments
No comments yet — be the first to post one!
Post a Comment