This website uses cookies. By clicking Accept, you consent to the use of cookies. Click Here to learn more about how we use cookies.
Turn on suggestions
Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.
- Revenera Community
- :
- InstallShield
- :
- InstallShield Forum
- :
- making changes using OpenView,SELECT, and Modify
Subscribe
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Subscribe
- Mute
- Printer Friendly Page
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
Dec 13, 2010
09:01 AM
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
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
(1) Reply
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
Dec 14, 2010
01:13 PM
If anybody is interested...
The way around this is to issue a Commit after every 100 Registry Table updates.
The way around this is to issue a Commit after every 100 Registry Table updates.