So I put a MSFlexGrid on one of my forms, and of course when I put the database on another computer, it gave the error broken reference to msflxgrd.ocx.
I searched around, and I have removed the reference in the database to the msflexgrid.
At start up, I have the program look in the system32 folder for the msflxgrd.ocx file, if it doesn't find it, it copies it from the network and regsrv32 shells to install it. Afterwards I do the application.references.addFromFile.
After doing all this, when you get to the form showing the msflexgrid, its not showing up correctly and causing issues.
after closing and re-opening, other contorls on that form are working, yet the msflxgrid contorl is just grey, none of the columns or cells show up. I get invalid reference errors on the lines of code for grid.object stating there is no object.
Is there a way to delcare the flexgrid, even though I have it on the form, at design time? Should I not put it on the form at design time? Should I only use code to put it on the form?
I'm trying to find the easiest way to have the database not display crazy errors, and at the same time, copy/register/reference the .ocx file.
Code:If FileSystem.Dir("c:\windows\system32\msflxgrd.ocx") = "" Then Call FileCopy("\\boise\group_boise\1 on 1\msflxgrd.ocx", "c:\windows\system32\msflxgrd.ocx") Call Shell("Start.exe Regsvr32.exe /s c:\windows\system32\msflxgrd.ocx") Application.References.AddFromFile ("c:\windows\system32\msflxgrd.ocx") Else Application.References.AddFromFile ("c:\windows\system32\msflxgrd.ocx") End If
EDIT: I found part of my problem. The code I was using to shell included start.exe which is not needed, and was throughing an error. Also, It seems to work fine if I leave the reference in there, other then the big untrapable "Broken Reference Error" that I get.
I'm going to try to remove the reference, and then check for the reference at start up, if it's not there, set the reference.


Reply With Quote
