I am just learning about ADO.
I’m trying to pass a parameter to a Jet query. I understand that the parameter must be passed using the connection object. I'm able to do that, and then set the recordset = command.execute. That works for forward only cursers, but I would like to set the recoredset to adOpenDynamic. What do I need to change in the following code to be able to do this? Thanks!
Dim cnNwind As Connection
Dim rsCustomer As Recordset
Dim comCommand As Command
Set cnNwind = New Connection
Set comCommand = New Command
cnNwind.ConnectionString = "Provider=Microsoft.Jet.OLEDB.3.51;" _
'set up command object
comCommand.CommandType = adCmdUnknown
comCommand.CommandText = "[qryTest]"
'create the parameter
comCommand.CreateParameter("title", adBSTR, adParamInput)
'Set the parameter value
comCommand.Parameters("title").Value = Text1.text
'associate object with active connection
comCommand.ActiveConnection = cnNwind
'request the recordset
Set rsCustomer = comCommand.Execute