Hi all, i have the following code to pass parameter into my Access DB to call a query.
Can i at the same time add statement in vb to sort recordset?
eg i wan to sort by StDate..?
Public Function Get_Reconcile_Qry(tmpdb As Connection, tmpStDate As Variant, tmpenddate As Variant, tmpAccCode As String) As Recordset
Dim x As New Recordset
Dim a As New Command
a.ActiveConnection = tmpdb.ConnectionString
a.CommandType = adCmdStoredProc
a.CommandText = "Bank_Reconcile"
a.Parameters.Append a.CreateParameter("StDate", adDate, adParamInput, , tmpStDate)
a.Parameters.Append a.CreateParameter("EndDate", adDate, adParamInput, , tmpenddate)
a.Parameters.Append a.CreateParameter("Account", adChar, adParamInput, 8, tmpAccCode)
Set x = a.Execute
Set Get_Reconcile_Qry = x
End Function
Can i at the same time add statement in vb to sort recordset?
eg i wan to sort by StDate..?
Public Function Get_Reconcile_Qry(tmpdb As Connection, tmpStDate As Variant, tmpenddate As Variant, tmpAccCode As String) As Recordset
Dim x As New Recordset
Dim a As New Command
a.ActiveConnection = tmpdb.ConnectionString
a.CommandType = adCmdStoredProc
a.CommandText = "Bank_Reconcile"
a.Parameters.Append a.CreateParameter("StDate", adDate, adParamInput, , tmpStDate)
a.Parameters.Append a.CreateParameter("EndDate", adDate, adParamInput, , tmpenddate)
a.Parameters.Append a.CreateParameter("Account", adChar, adParamInput, 8, tmpAccCode)
Set x = a.Execute
Set Get_Reconcile_Qry = x
End Function