Support Statement: Modifying VB6 Source Files
If you need to make a series of permanent changes to the VB6 source -- for example, to make it ready for running and testing in a specific environment -- you can use the gmPL Fix
command. Â Not to be confused with compile/fix
, gmPL Fix
is a top-level command that does a search and replace on a specific named file. Â The command may be placed in a custom script file and added to your Migration Project file (.gmProj
) so that it is handy for applying on new versions of the source as it changes over time.
For example here is a script that changes the database connection information in a file.
Â
SrcName = [VB6_Edit] SrcProj = [C:\gmClients\clientX\proj\usr\VB6_Edit.xml] SrcType = [XML] BldType = [CUSTOM] TScript = [C:\gmClients\clientX\proj\usr\VB6_Edit.xml] <gmBasic> <Storage Action="Create" Identifier="VB6Edit" /> <Select Progress="1"/> <Fix name="Pre-Edit" fileFilter="C:\gmClients\clientX\src\clientX\Claims_Administration\SourceCode\frmDBselect.frm"> <Replace name="frmDBselect.frm"> <OldBlock><![CDATA[ mainModule.strprimaryConnection = "Provider=SQLOLEDB;Integrated Security=SSPI;" & _ "Initial Catalog=" & cboDB.Text & ";Data Source=" & cboServer.Text & ";Network Library=dbnmpntw" ]]></OldBlock> <NewBlock><![CDATA[ cboServer.Text = "GMI-CS-02.gmi.local" 'GM fix: modify ConnectionString for GM Lab mainModule.strprimaryConnection = "Provider=SQLOLEDB;Integrated Security=SSPI;" & _ "Initial Catalog=" & cboDB.Text & ";Data Source=" & cboServer.Text & ";" 'Network Library=dbnmpntw" ]]></NewBlock> </Replace> </Fix> <Storage Action="Close" /> </gmBasic>
When applied, this script produces the following log:
Basic Processor V20.01(Beta.003) System Build(12/03/13 13:51:18)
REPLACE Line=[7] Lang=[All] Name=[Pre-Edit:frmDBselect.frm] host=[C:\gmClients\clientX\src\clientX\Claims_Administration\SourceCode\frmDBselect.frm] Type=[ReplaceGlobal]
Translation Time (sec) = 0.11
Â
Â