Imran
  • Imran
  • Member Topic Starter
2017-04-10T19:49:00Z
Hi,
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
To
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!

Thanks,
Imran
Igor/10Tec
2017-04-11T06:42:13Z
A good question! Many years ago we wrote a tool to automate this process for VB6 projects. It is OCX Updater:

http://10tec.com/vb6-project-references-update/ 

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 ,
		0x0000000000000000
	End
	OLEClass ="10Tec iGrid Control 6.5"
	Class ="iGrid650_10Tec.iGrid"
	GUID = Begin
		0x96e1085a89311b47b8a27282712a55b4
	End
	GridlineColor =10921638

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

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
  • Imran
  • Member Topic Starter
2017-04-11T15:39:49Z
Ah, good idea Igor, I actually forgot that I used scripts to export my code so I can manage the Source Code in SVN.

https://github.com/crazedsanity/MSAccessUtilities 

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
0xe08f24cd45a38c4799c7f1a16b8340ac
End
Igor/10Tec
2017-04-12T06:51:04Z
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
  • Imran
  • Member Topic Starter
2017-11-30T18:45:57Z
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.

Imran__Access.jpg

Click to View Image82 View(s)



Imran
Henrik
2018-12-18T20:13:57Z
Hi, I made a solution for upgrading grid-controls in MS Access.

You can find it here 

/Henrik
Imran
  • Imran
  • Member Topic Starter
2019-04-10T14:55:51Z
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
Henrik
2019-05-08T06:35:07Z
Imran, great to hear! Strange about the resize glitch. Did you compile after the upgrade was complete?