Results 1 to 12 of 12
  1. #1
    Join Date
    Oct 2004
    Posts
    86

    Unanswered: Compile Error, Cant find project or library

    Hi im using the "Environ" function in some code to fetch the usersprofile and assign it to a variable

    my db works on some PC's and not others, all PCs should have the same image as in access version OS version service packs etc... the only difference in the PC's is that some are Dells Some are HP's, all the references are the same but when i run my db on the HP machines i get "Compile Error, Cant find project or library" but not on the Dells

    can anyone help me with this please?

    All PC's using access 97, on NT over a LAN

    thank you

  2. #2
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    you are going to have to do some footwork.....
    you need to reslove the differences between the machines
    is one type more recent than the others, are they all on the same software build, are they all on the same service pack, are the library version and time stamps the same

    My first suspect would be either the OS is not at the same service pack state, and / or the application software is not at the same service pack state.

    the environ function works but it may have a problem if you have an early build of NT.

    I do not believe that a machine made by one hardware vendor will differ in this manner with a machine from another vendor, especailly as the 2 manufacturers concerned are HP & DELL.

  3. #3
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    scottemotive
    can you post a copy of the precise code you are using to call the environ function
    I've tried to locate here what the library that supplies environ and its part of the core VBA library, so if you are using office 97 or later then it should eb included

  4. #4
    Join Date
    Jan 2004
    Location
    Aberdeen, Scotland
    Posts
    1,067
    Here's a little bit of code for excel to list the Environ settings for your machines you could test these on your machines to test to see if there are any that you use that change between the 2 machine setups (im using an hp machine), i wouldnt of thought so but you can give it a try if you want

    Code:
    Sub testEnviron()
        For i = 1 To 100000
            mycheck = Environ(i)
            If mycheck = "" Then Exit For
            Cells(i, 1).Formula = mycheck
        Next i
    End Sub

  5. #5
    Join Date
    Oct 2004
    Posts
    86
    The PC That works (mine)
    BICCFG=c:\progra~1\Kofax\imgctls\BIN\BIC.CFG
    COMPUTERNAME=HSS100348
    ComSpec=C:\WINNT\system32\cmd.exe
    HOMEDRIVE=H:
    HOMEPATH=\barrsz
    HOMESHARE=\\ssgdc02\home$
    INCLUDE=C:\Sybase\OCS-12_0\include;C:\Sybase\OCS-12_0\include
    LIB=C:\Sybase\OCS-12_0\lib;C:\Sybase\OCS-12_0\lib
    LOGONSERVER=\\DOC
    NUMBER_OF_PROCESSORS=1
    OS=Windows_NT
    Os2LibPath=C:\WINNT\system32\os2\dll;
    Path=C:\Program Files\Microsoft Office\Office;C:\Sybase\OCS-12_0\dll;C:\Sybase\OCS-12_0\bin;C:\WINNT\system32;C:\WINNT;C:\PROGRA~1\KO FAX\IMGCTLS\BIN
    PATHEXT=.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WS F;.WSH
    PROCESSOR_ARCHITECTURE=x86
    PROCESSOR_IDENTIFIER=x86 Family 6 Model 8 Stepping 10, GenuineIntel
    PROCESSOR_LEVEL=6
    PROCESSOR_REVISION=080a
    SYBASE=C:\Sybase
    SYBASE_OCS=OCS-12_0
    SystemDrive=C:
    SystemRoot=C:\WINNT
    TEMP=C:\TEMP
    TMP=C:\TEMP
    USERDOMAIN=SSGROUP
    USERNAME=barrsz
    USERPROFILE=C:\WINNT\Profiles\barrsz
    windir=C:\WINNT

    The PC that dosnt:


    COMPUTERNAME=HSS11879
    ComSpec=C:\WINNT\system32\cmd.exe
    HOMEDRIVE=H:
    HOMEPATH=\grictz
    HOMESHARE=\\ssgdc02\home$
    LOGONSERVER=\\SSGDC01
    NUMBER_OF_PROCESSORS=1
    OS=Windows_NT
    Os2LibPath=C:\WINNT\system32\os2\dll;
    Path=C:\Program Files\Microsoft Office\Office;C:\WINNT\system32;C:\WINNT
    PATHEXT=.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WS F;.WSH
    PROCESSOR_ARCHITECTURE=x86
    PROCESSOR_IDENTIFIER=x86 Family 15 Model 2 Stepping 9, GenuineIntel
    PROCESSOR_LEVEL=15
    PROCESSOR_REVISION=0209
    SystemDrive=C:
    SystemRoot=C:\WINNT
    TEMP=C:\TEMP
    TMP=C:\TEMP
    USERDOMAIN=SSGROUP
    USERNAME=grictz
    USERPROFILE=C:\WINNT\Profiles\grictz
    windir=C:\WINNT

  6. #6
    Join Date
    Jan 2004
    Location
    Aberdeen, Scotland
    Posts
    1,067
    Have you added any referrences to your code, as i see nothing in the above that is remarkably different

  7. #7
    Join Date
    Oct 2004
    Posts
    86
    ive found the problem

    the new pcs are missing dao360.dll as a reference

    so do i either use 3.5 in the db or put 3.6 in the new pcs? (which i know the IT dept wont like)

  8. #8
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    DAO 3.6 every time!, and tell the IT department to get a life
    Seriously though you shoudl consider binning DAO in favour of ADO - that's the next generation of data object that will be supported into the future. I don't think there's been an announcement but I doubt if DAO will get any more changes / enhancements / bug fixes.

    On a seperate note on both the debug scripts of the environ variable the userprofile is set as you originally requested. IE environ("USERPROFILE") has given what you originally requested.

  9. #9
    Join Date
    Jan 2004
    Location
    Aberdeen, Scotland
    Posts
    1,067
    easyish soloution to this we can set the references at start up
    i only know how to check these in excel so here we go
    open a new workbook and set both references up (on same pc or different pc's)
    add the code to a module
    Code:
    Sub Grab_References()
    'pulls all references that are loaded into the project
    Dim n As Integer
    
    'add a worksheet to the workbook for holding these references
        Sheets.Add
        ActiveSheet.Name = "GUIDS"
    
    'loop through the references and find all the references
    'and add the information to the new worksheet
        On Error Resume Next
        For n = 1 To ActiveWorkbook.VBProject.References.Count
            Cells(n, 1) = ActiveWorkbook.VBProject.References.Item(n).Name
            Cells(n, 2) = ActiveWorkbook.VBProject.References.Item(n).Description
            Cells(n, 3) = ActiveWorkbook.VBProject.References.Item(n).GUID
            Cells(n, 4) = ActiveWorkbook.VBProject.References.Item(n).Major
            Cells(n, 5) = ActiveWorkbook.VBProject.References.Item(n).Minor
            Cells(n, 6) = ActiveWorkbook.VBProject.References.Item(n).fullpath
        Next n
    
    End Sub
    this will give you all the references you need to open the references at start up

    add this code to your autoexec procedure
    Code:
    Dim refAdd
    Dim RefId(3) As String, MajorId(3) As Integer, MinorId(3) As Integer
    
        On Error Resume Next
        'Reference Object Library using Major / Minor GUID
        
        'Microsoft DAO 3.5 Object Library
        'as below but with your reference number for 3.5
        'Microsoft DAO 3.6 Object Library
        RefId(2) = "{00025E01-0000-0000-C000-000000000046}": MajorId(2) = 5: MinorId(2) = 0
        
        
        'add the references if they arn't there already
        For I = 1 To 2
            Set refAdd = ThisWorkbook.VBProject.References
            refAdd.AddFromGuid RefId(I), MajorId(I), MinorId(I)
        Next I
        
        On Error GoTo 0
    this should add the references that you want

    and finally addthis code to the part where you come out of your db
    Code:
    'remove DAO reference
    Dim x As Object
    Dim y As String
    Dim n As Integer
    
        'count of references that reside in the VBE Projecy
        n = Application.VBE.ActiveVBProject.References.Count
    
        Do While Application.VBE.ActiveVBProject.References.Count > 0 And n > 0
            On Error Resume Next
            Set x = Application.VBE.ActiveVBProject.References.Item(n)
            y = x.Name
            If y = "DAO" Then
                Application.VBE.ActiveVBProject.References.Remove x
            End If
            n = n - 1
        Loop
    this should set your machine specific references and not force you out with an error

    Dave

  10. #10
    Join Date
    Oct 2004
    Posts
    86
    Excellent thank you,

    ive changed the file on my server that the backend would call (this is an update db that overwrites the client with newer version)
    ive changed it to 3.5 (as opposed to 3.6)

    this now works on all machines, so i think all round im happy. as good as the code above looks id prefer not to copy new references to machines missing these as my IT dept are quite strict with dll's etc.. so as it works i wont fix it at the moment.

    what are the benefits of ADO? and what would i have to do? implications etc...?

  11. #11
    Join Date
    Jan 2004
    Location
    Aberdeen, Scotland
    Posts
    1,067
    My code doesn't copy dll's accross it just adds the references just as you would when you use the GUI (graphical user interface) tool.

  12. #12
    Join Date
    Oct 2004
    Posts
    86
    ah right sorry i only skimmed through it, however the reference is missing in the references box, does that mean the DLL is missing from the system?

Posting Permissions

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