Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

error please help

Status
Not open for further replies.

skierm

Programmer
Jun 9, 2003
39
US
here is my code

Public Sub ChangeInventory()
Dim cmd as ADODB.Command
Dim rs as ADODB.Recordset
set cmd = New ADODB.command
cmd.ActiveConnection = cnn
cmd.CommandText = "select * from edition where edition = " & num2
cmd.CommandType = adCmdText
set rs = cmd.execute
if (rs.eof) then
do something
else


MY ERROR IS HERE
rs.Fields("ptrOrderLine").value = 0
endif
rs.close
set rs = nothing
end sub

Its telling me that the current recordset does not support updating. This may be a limitation of the provider, or of the selected locktype. What can i do to fix this, Im lost. Thanks

 
try rst.open instead of cmd.execute..

cmd.execute returns a forward only (ReadOnly?) recordset, which may be the problem.
 
Its telling me that the current recordset does not support updating.

It might be telling you that you don't have a recordset. You should create the recordset before using it:
Code:
set rs = New ADODB.Recordset
rs = cmd.execute
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top