cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Cygnusx1
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):
'~enumerationStart
Call MODIFY_DB("`Registry`","`Registry`",,)
'~enumerationEnd
'>>>Placing Commit here does not work
Database.Commit:CheckError

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

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

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