Showing results for 
Show  only  | Search instead for 
Did you mean: 
Level 8

making changes using OpenView,SELECT, and Modify

We have a need to make numerous modifications to the Registry Table. I am modifying the keyfile so naturally I am using OpenView, Select, and Modify. The problem is not making the modifications it is in the committing part that does not work; sometimes with an error(generic), sometimes not; but always with no changes being made.

Using vbscript, I enumerate through the registry table and then call a function to use Modify. When all the modifications are complete thats when I call Database.Commit.
Placing the commit within the Function works but it is extreeeemly slow.

The question is why doesn't commit work after the enumeration and only after Modify?

Here is the function and Call (object setups have been omitted):
Call MODIFY_DB("`Registry`","`Registry`",,)
'>>>Placing Commit here does not work

Function MODIFY_DB(sTable,sPrimaryKey,sOldVal,sNewVal)
Set View = Database.OpenView("SELECT * FROM " & sTable & " WHERE " & sPrimaryKey & " = '" & sOldVal & "'"):CheckError

Set Record = View.Fetch
Record.StringData(1) = sNewVal
View.Modify 4, Record:CheckError
'>>>Placing commit here allows everyting to work
Set Record = Nothing : View.Close :Set View = Nothing
End Function
Labels (1)
0 Kudos
1 Reply
Level 8

If anybody is interested...
The way around this is to issue a Commit after every 100 Registry Table updates.
0 Kudos