[RESOLVED] msflexgrid copy access DB to another computer-VBForums
Results 1 to 3 of 3

Thread: [RESOLVED] msflexgrid copy access DB to another computer

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Jul 2006
    Location
    Anchorage, Alaska
    Posts
    545

    Resolved [RESOLVED] msflexgrid copy access DB to another computer

    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.
    Last edited by rack; May 23rd, 2008 at 01:43 PM.
    Please RATE posts, click the RATE button to the left under the Users Name.

    Once your thread has been answered, Please use the Thread Tools and select RESOLVED so everyone knows your question has been answered.


    "As I look past the light, I see the world I wished tonight, never the less, sleep has come, and death shall soon follow..." © 1998 Jeremy J Swartwood

  2. #2

    Thread Starter
    Fanatic Member
    Join Date
    Jul 2006
    Location
    Anchorage, Alaska
    Posts
    545

    Re: msflexgrid copy access DB to another computer

    Alright, I was able to get it all working.

    First step after completely the design and creation of the form with the flex grid before distrubuting is to Remove the reference to the flex grid.

    Second step is to save and close the database.

    Third is have the person open the database on there computer, which will run the following code first.

    If anyone has a better way, allowing me to leave the reference in while distrubuting, but catch the error before it is displayed please let me know

    Code:
    
    Dim refCurr As Reference
    Dim FoundIt As Boolean
    
    
            For Each refCurr In Application.References
                If refCurr.Name = "MSFlexGridLib" Then
                    FoundIt = True
                    Exit For
                End If
            Next
        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("Regsvr32.exe /s c:\windows\system32\msflxgrd.ocx")
         END IF
        If FoundIt = False Then
            Application.References.AddFromFile ("c:\windows\system32\msflxgrd.ocx")
        End If
    Please RATE posts, click the RATE button to the left under the Users Name.

    Once your thread has been answered, Please use the Thread Tools and select RESOLVED so everyone knows your question has been answered.


    "As I look past the light, I see the world I wished tonight, never the less, sleep has come, and death shall soon follow..." © 1998 Jeremy J Swartwood

  3. #3
    Lively Member
    Join Date
    Jan 2012
    Posts
    71

    Re: [RE-OPENED] msflexgrid copy access DB to another computer

    Iím struggling from last 10 days to resolve this issue and I have tried all the options but still getting same below error.

    Run-time error Ď438í:
    Object doesnít support this property or method.

    Below is the code

    Private Sub InitProc()
    txtSearch.Value = ""
    MSFG1.ColWidth(0) = 0
    MSFG1.ColWidth(1) = 1500
    MSFG1.ColAlignment(1) = 0
    MSFG1.ColWidth(2) = 4500
    MSFG1.ColAlignment(2) = 0
    MSFG1.ColWidth(3) = 1500
    MSFG1.TextMatrix(0, 1) = "User ID" 'Assign the value of "User ID" Field
    MSFG1.TextMatrix(0, 2) = "User Name"
    MSFG1.TextMatrix(0, 3) = "Status"
    End Sub

    Please note MSFLXGRD.OCX file is available in \Windows\System32 directory and has been un-registered and re-registered

    File: MSFlxGrd.ocx (Version: 6.1.98.14)
    MS Access: 2007
    Microsoft Visual Basic Runtime 6 SP 6 (v 6.6)
    Operating System: Windows XP

    Highly appreciate your help on this issue

    Million of thanks in advance.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Featured


Click Here to Expand Forum to Full Width

Survey posted by VBForums.