DebbieDavis
Programmer
Hello all, I wrote the following code for an Active Server Page but I really need to use it in Access. Could someone please help me convert it and maybe help me know how to use it in Access? Please forgive my ignorance. I don't get to use Access too much. Many thanks!
Code:
'Create a recordset object
Set oRs = Server.CreateObject("ADODB.RecordSet")
' Open the table
oRs.Open "customers", objConn, adOpenKeySet, adLockPessimistic, adCmdTable
if not oRs.eof then
do while not oRs.EOF
oRs.Update
on error resume next
For Each fld in oRS.Fields
'If a value for the column name was passed in,
'set the column name equal to the value passed through the form...
if fld.value>0 then
fld.Value = trim(fld.value)
end if
Next
oRs.MoveNext
loop
else
Response.Write "This record did not get updated."
end if