S
SAm
hi
i am pasting in here my code. my question is can i do a recordcount on a
recordset that is based on a command (query) ? for some reason it doesn't
work. i can do things with the field names i can work with the recordset, but
i can't get the recordcount to work. i tried changing the type of the
recordset but i got an error for that. any ideas?
Dim cmd As ADODB.Command
Dim pa As ADODB.Parameter
Dim rstGetRecordSet As ADODB.Recordset
Set cmd = New ADODB.Command
Set pa = New ADODB.Parameter
Set cmd.ActiveConnection = CurrentProject.Connection
cmd.CommandText = "MyQueryQry"
cmd.CommandType = adCmdTable
cmd.Parameters.Refresh
For Each pa In cmd.Parameters
pa.Value = Eval(pa.Name)
Next pa
Set rstGetRecordSet = New ADODB.Recordset
Set rstGetRecordSet = cmd.Execute
i am pasting in here my code. my question is can i do a recordcount on a
recordset that is based on a command (query) ? for some reason it doesn't
work. i can do things with the field names i can work with the recordset, but
i can't get the recordcount to work. i tried changing the type of the
recordset but i got an error for that. any ideas?
Dim cmd As ADODB.Command
Dim pa As ADODB.Parameter
Dim rstGetRecordSet As ADODB.Recordset
Set cmd = New ADODB.Command
Set pa = New ADODB.Parameter
Set cmd.ActiveConnection = CurrentProject.Connection
cmd.CommandText = "MyQueryQry"
cmd.CommandType = adCmdTable
cmd.Parameters.Refresh
For Each pa In cmd.Parameters
pa.Value = Eval(pa.Name)
Next pa
Set rstGetRecordSet = New ADODB.Recordset
Set rstGetRecordSet = cmd.Execute