Error 3251 current recordset does not support updating
I didn't read the code carefully though, so may have missed them. Firstly you might take a shot at changing some of your coding habits. When you are accessing recordset fields it is important to identify the field with something other than 0, 1 and 2.
Or are they supposed to be in the code where you have the "UPDATING STUFF HERE" type comment? You will always have to check back to see what they mean. When you are accessing recordset fields it is important to identify the field with something other than 0, 1 and 2.
Please join our friendly community by clicking the button below - it only takes a few seconds and is totally free.
Execute("SELECT hs_cod FROM hs_log where prd_dsc = '" LCase(txt Desc.value) "'") Set prd ID = conn. Range("B: C"), 2) 'If stor Tar Dsc Prd = "1" Then 'store tariff and description If Not (prd Dsc. EOF) Then 'There are no records if Beginning-Of-File and End-Of-File are both true.
Execute("INSERT INTO hs_log (prd_dsc, hs_cod) VALUES '" LCase(Trim(txt Desc.value)) "','" Trim(cbo Tariff No2.value) "'") Msg Box "Insert" End If 'Else If stor Tar Dsc Prd = "2" Then 'store tariff and productid 'Else 'dont store tariff 'End If 'Error Handler: 'Err. I believe that the way you've declared it will result in it being a Variant rather than an ADODB. This might not be an issue but better to eliminate the possibility by declaring it explicitly.
I'm trying to find out if any records exist, if they do, edit the record. but i'm getting the error message: Run-time error '3251': Current Recordset does not support updating. ", Buttons:=vb Yes No, Title:="e Prisoft") If Edit Tar = vb Yes Then prd Dsc("hs_cod") = Trim(cbo Tariff No2.value) prd Dsc. Execute("UPDATE hs_log SET hs_cod = '" Trim(cbo Tariff No2.value) "' WHERE prd_dsc = '" LCase(Trim(txt Desc.value)) "'") End If Msg Box "Edit" Else 'else insert new record prd Dsc.
This may be a limitation of the provider, or of the selected locktype. Add New prd Dsc("prd_dsc") = LCase(Trim(txt Desc.value)) prd Dsc("hs_cod") = Trim(cbo Tariff No2.value) prd Dsc. Close Set conn = Nothing End Sub Set prd Dsc = New ADODB.
Connection String = "Provider=MSDAORA.1; Password=3389mine; User ID=system; Data Source=192.168.167.22; Persist Security Info=True" cn. Open "select * from ITINVENTORY order by ID", cn, ad Open Dynamic, ad Lock Optimistic If rs.