• Imran
  • Member Topic Starter
Are there any best practices for upgrading IGrid from v5 to v6.5 in a MS Access application. I've been testing different methods and right now the only way I can seem to do it is to delete the grid on my form, recreate the grid using the v6.5 object and then setting the object name to the same name as the v5 object and resizing it. Luckily all my other property settings are done through code but this is still going to be a time intensive and very boring process. I have 40 or 50 grids in my app I need to update.

Also, In my code, I've had to change references from:
Dim moGridAvailability As iGrid
Dim moGridAvailability As iGrid650_10Tec.iGrid

Since I've got both versions of the grid in my app while I'm converting and testing it as I go.
This is not as big of a deal as the form elements since I can use a Search and Replace

Would be interested to hear if anyone has a better way!

A good question! Many years ago we wrote a tool to automate this process for VB6 projects. It is OCX Updater: 

I do not know whether this approach can be applied to MS Access forms, but I have an idea.

You can export an Access form to a text file using the undocumented Application.SaveAsText method:

Howto: Export all Forms into text file[s] 

If you open the exported text file, you'll find a block describing an iGrid instance on a form similar to this:

Begin CustomControl
	Enabled = NotDefault
	SizeMode =1
	OldBorderStyle =0
	OverlapFlags =85
	Left =226
	Top =226
	Width =9360
	Height =7950
	AutoActivate =1
	BorderColor =12835293
	Name ="grdMain"
	OleData = Begin
		0x000e0000d0cf11e0a1b11ae1000000000000000000000000000000003e000300 ,
		0xfeff090006000000000000000000000001000000020000000000000000100000 ,
		0x0400000001000000feffffff0000000003000000ffffffffffffffffffffffff ,
		0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff ,
		0x0000000000000000000000000000000000000000000000000000000000000000 ,
	OLEClass ="10Tec iGrid Control 6.5"
	Class ="iGrid650_10Tec.iGrid"
	GUID = Begin
	GridlineColor =10921638

	LayoutCachedLeft =226
	LayoutCachedTop =226
	LayoutCachedWidth =9586
	LayoutCachedHeight =8176

Theoretically we can replace the OLEClass, Class and GUID for the old iGrid with the corresponding values from the new version of the OCX and load the new text form definition using the Application.LoadFromText method, but the only thing I am not sure about is that OleData binary field. Can we use it "as is" when upgrading to the new control this way?

You can experiment with the forms from your real-world Access database app and tell us the result here. Keep us informed, please. I think this question is interesting for many Access developers using our ActiveX grid. If all is ok, maybe, eventually we will create a tool like OCX Updater for MS Access.
  • Imran
  • Member Topic Starter
Ah, good idea Igor, I actually forgot that I used scripts to export my code so I can manage the Source Code in SVN. 

I can try using the rebuildFromTextFiles.vbs to put the code back into my database after replacing the text.

In the code, I would replace this:

OLEClass ="10Tec iGrid Control 5.0"
Class ="iGrid500_10Tec.iGrid"

With this:
OLEClass ="10Tec iGrid Control 6.5"
Class ="iGrid650_10Tec.iGrid"

But how do I know what the new GUID should be?
GUID = Begin
Looking at the text versions of forms I exported, I can suppose that it is just a global unique identifier for every control on the form. Most likely, it is assigned to a control instance when we place it on a form. Note also that controls of the same type have various GUIDs, which should prove my thought too.

Try to leave these GUID values "as is".
  • Imran
  • Member Topic Starter
Ultimately, this approach did not work. The properties of the object were updated but the object as it exists on the form did not get upgraded to the new version and my code experienced Type Mismatch errors when referring to the objects on the form.


Click to View Image78 View(s)

Hi, I made a solution for upgrading grid-controls in MS Access.

You can find it here 

  • Imran
  • Member Topic Starter
Henrik, this tool was very helpful for the 7.0 upgrade I just did. I did find that I had to double click and resize each grid control on every form. Some sort of glitch. But overall it saved me a ton of time.
Thanks for posting this.
Imran, great to hear! Strange about the resize glitch. Did you compile after the upgrade was complete?