Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

Options
Go to last post Go to first unread
Imran  
#1 Posted : Monday, April 10, 2017 7:49:00 PM(UTC)
Imran

Rank: Newbie

Groups: Registered
Joined: 4/10/2017(UTC)
Posts: 6
Location: Chicago

Was thanked: 1 time(s) in 1 post(s)
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  
#2 Posted : Tuesday, April 11, 2017 6:42:13 AM(UTC)
Igor/10Tec

Rank: Administration

Groups: Administrators, Forum Moderator
Joined: 1/17/2011(UTC)
Posts: 843

Thanks: 11 times
Was thanked: 111 time(s) in 111 post(s)
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:

Code:
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  
#3 Posted : Tuesday, April 11, 2017 3:39:49 PM(UTC)
Imran

Rank: Newbie

Groups: Registered
Joined: 4/10/2017(UTC)
Posts: 6
Location: Chicago

Was thanked: 1 time(s) in 1 post(s)
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  
#4 Posted : Wednesday, April 12, 2017 6:51:04 AM(UTC)
Igor/10Tec

Rank: Administration

Groups: Administrators, Forum Moderator
Joined: 1/17/2011(UTC)
Posts: 843

Thanks: 11 times
Was thanked: 111 time(s) in 111 post(s)
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".
Users browsing this topic
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.