Hi,
I have this bit of code that I am testing using ado command and parameters. The code goes against a Access 97 database query named "ClaimsShipmentInfoByShipment". The query requires one parameter, "Shipment". The query works in Access, but does not return a recordset using the snipit below.
Any help will be appreciated.
Set cmd = New ADODB.Command
Set Parm = New ADODB.Parameter
Set rs = New ADODB.Recordset
Conn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=d:/db/shipping.mdb"
cmd.ActiveConnection = Conn
cmd.CommandType = 4
dummystring = "37940 SJZ"
RecordSelects = "ClaimsShipmentInfoByShipment"
Set Parm = cmd.CreateParameter("Shipment", 8, 1, Len(dummystring), dummystring)
cmd.Parameters.Append Parm
cmd.CommandText = RecordSelects
cmd.Execute
rs.Open cmd
Do Until rs.EOF
MsgBox (rs.Fields("name")
rs.MoveNext
Loop
I have this bit of code that I am testing using ado command and parameters. The code goes against a Access 97 database query named "ClaimsShipmentInfoByShipment". The query requires one parameter, "Shipment". The query works in Access, but does not return a recordset using the snipit below.
Any help will be appreciated.
Set cmd = New ADODB.Command
Set Parm = New ADODB.Parameter
Set rs = New ADODB.Recordset
Conn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=d:/db/shipping.mdb"
cmd.ActiveConnection = Conn
cmd.CommandType = 4
dummystring = "37940 SJZ"
RecordSelects = "ClaimsShipmentInfoByShipment"
Set Parm = cmd.CreateParameter("Shipment", 8, 1, Len(dummystring), dummystring)
cmd.Parameters.Append Parm
cmd.CommandText = RecordSelects
cmd.Execute
rs.Open cmd
Do Until rs.EOF
MsgBox (rs.Fields("name")
rs.MoveNext
Loop