Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

DLL Problem in Access 2.0

Posted on 2002-04-25
14
Medium Priority
?
393 Views
Last Modified: 2007-11-27
Within an Access 2.0 appication I have the need to allow the user to select a file using the standard file open dialogue box. This is called using:

lRet = MSAU_GetFileName(gfni, fOpen)

..where MSAU_GetFileName is contained within the DLL file MSAU200.DLL (or so I believe). This DLL was not present on the shared drive where the application is installed and thus the users got an error when trying to run this command. When I put the DLL in place it worked...for everybody except 1 user !!

Does anybody know of any reasons why 1 user out of 10 would continue to get the error cuased by the non existance of MSAU200.DLL even though it is now there ? I've tried getting them to log in / log out / reboot but to no effect.

Any ideas ?

Thanks...PaulC.
0
Comment
Question by:paulclem
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
14 Comments
 
LVL 58
ID: 6968280
<<Any ideas ?>>

 Does the one user have a runtime install of Access rather then the full version?

 I think if you check one of the other machines that is working, you'll find the DLL is already somewhere else on the PC.

 The only other thing I can think of is that Access searches the current directory first, then the windows directory and then \windows\system for DLLs, and after that the path statement (may have that last part backwards).

 When starting the app, make sure the "Start in" is correctly set for the shortcut, or do an explicit CD to the correct directory in the app.

Jim.
0
 
LVL 12

Expert Comment

by:James Elliott
ID: 6968284
Sounds strange. Is the anomolous person running a different version of access?

Thanks

Jell
0
 

Author Comment

by:paulclem
ID: 6968357
JDettman said:

"I think if you check one of the other machines that is working, you'll find the DLL is already somewhere
else on the PC"

...To test this I actually removed MSAU200.DLL from the shared installtion directory. Having done this the file open dialog didn't appear for anybody and they all got the error message that "the 1" has been getting all along.

When I then put MSAU200.DLL back in place everybody was ok again..apart from "the 1". This proves to me that this file being in the install directory is what is needed to get the file open dialog to work...so why is this 1 person having a problem when they are all accesing the same shared drive ?

Paul C.
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 58
ID: 6968382
Paul,

<<This proves to
me that this file being in the install directory is what is needed to get the file open dialog to work...so
why is this 1 person having a problem when they are all accesing the same shared drive ?>>

  Are they starting the app differently then the others?  In other words, are you sure their current directory is set to the shared directory?  Do they have adaquate rights to read all the files in the shared directory?

Jim.
0
 

Author Comment

by:paulclem
ID: 6968406
JDettman said:

"I think if you check one of the other machines that is working, you'll find the DLL is already somewhere
else on the PC"

...To test this I actually removed MSAU200.DLL from the shared installtion directory. Having done this the file open dialog didn't appear for anybody and they all got the error message that "the 1" has been getting all along.

When I then put MSAU200.DLL back in place everybody was ok again..apart from "the 1". This proves to me that this file being in the install directory is what is needed to get the file open dialog to work...so why is this 1 person having a problem when they are all accesing the same shared drive ?

Paul C.
0
 

Author Comment

by:paulclem
ID: 6968434
JDettman said:

"I think if you check one of the other machines that is working, you'll find the DLL is already somewhere
else on the PC"

...To test this I actually removed MSAU200.DLL from the shared installtion directory. Having done this the file open dialog didn't appear for anybody and they all got the error message that "the 1" has been getting all along.

When I then put MSAU200.DLL back in place everybody was ok again..apart from "the 1". This proves to me that this file being in the install directory is what is needed to get the file open dialog to work...so why is this 1 person having a problem when they are all accesing the same shared drive ?

Paul C.
0
 
LVL 58
ID: 6968589
Paul,

  You keep repeating the same message which I already responded to.

Jim.
0
 

Author Comment

by:paulclem
ID: 6968686
yeh...I didn't mean too....just seems to keep adding itself on....he he.

Cheers,

PaulC.
0
 
LVL 58
ID: 6968732
Paul,

  Don't use the refresh button.  It will cause the page to be resubmitted.

Jim.
0
 
LVL 5

Expert Comment

by:bob_online
ID: 6968850
The dll might be referencing other dll's that are not on that one users pc.  Download dependency walker from this link to check for that possiblity.

http://www.dependencywalker.com/
0
 

Author Comment

by:paulclem
ID: 6968934
ok...downloaded that...what do I do with it ? What do I use as the input file ?...I tried a .mdb...didn't like that.

PaulC.
0
 
LVL 10

Expert Comment

by:RichardCorrie
ID: 6971762
Here are some function for open/save files or folders that use the windows conmmon API rather than the msaccess dll

Richard

Attribute VB_Name = "CommonDialogAPI"
Option Explicit

Private Const mcstrModule As String = "CES_basAPIGetData"
' Type for common dialog functions

Type CES_OPENFILENAME
     lStructSize As Long
     hWndOwner As Long
     hInstance As Long
     lpstrFilter As String
     lpstrCustomFilter As String
     nMaxCustFilter As String
     nFilterIndex As Long
     lpstrFile As String
     nMaxFile As Long
     lpstrFileTitle As String
     nMaxFileTitle As Long
     lpstrInitialDir As String
     lpstrTitle As String
     Flags As Long
     nFileOffset As Integer
     nFileExtension As Integer
     lpstrDefExt As String
     lCustData As Long
     lpfnHook As Long
     lpTemplateName As String
End Type

' Private Variables

Declare Function MyGetOpenFileName Lib "COMDLG32.DLL" Alias "GetOpenFileNameA" (ofil As CES_OPENFILENAME) As Integer
Declare Function MyGetSaveFileName Lib "COMDLG32.DLL" Alias "GetSaveFileNameA" (ofil As CES_OPENFILENAME) As Integer
'Declare Function Mylstrcpy Lib "Kernel32" Alias "lstrcpyA" (ByVal DestString As String, ByVal SourceString As String) As Long
Declare Function MyCommDlgExtendedError Lib "COMDLG32.DLL" Alias "CommDlgExtendedError" () As Long
Declare Function Frog_GetActiveWindow Lib "user32" Alias "GetActiveWindow" () As Long

Private Declare Function apiWNetGetConnection Lib "mpr.dll" Alias "WNetGetConnectionA" _
  (ByVal strLocalName As String, ByVal strRemoteName As String, _
   ByRef rlngRemoteNameLen As Long) As Long

Private Const CMDLG_OFN_READONLY = &H1
Private Const CMDLG_OFN_OVERWRITEPROMPT = &H2
Private Const CMDLG_OFN_HIDEREADONLY = &H4
Private Const CMDLG_OFN_NOCHANGEDIR = &H8
Private Const CMDLG_OFN_SHOWHELP = &H10
Private Const CMDLG_OFN_ENABLEHOOK = &H20
Private Const CMDLG_OFN_ENABLETEMPLATE = &H40
Private Const CMDLG_OFN_ENABLETEMPLATEHANDLE = &H80
Private Const CMDLG_OFN_NOVALIDATE = &H100
Private Const CMDLG_OFN_ALLOWMULTISELECT = &H200
Private Const CMDLG_OFN_EXTENSIONDIFFERENT = &H400
Private Const CMDLG_OFN_PATHMUSTEXIST = &H800
Private Const CMDLG_OFN_FILEMUSTEXIST = &H1000
Private Const CMDLG_OFN_CREATEPROMPT = &H2000
Private Const CMDLG_OFN_SHAREAWARE = &H4000
Private Const CMDLG_OFN_NOREADONLYRETURN = &H8000
Private Const CMDLG_OFN_NOTESTFILECREATE = &H10000

Private Const CMDLG_OFN_SHAREFALLTHROUGH = 2
Private Const CMDLG_OFN_SHARENOWARN = 1
Private Const CMDLG_OFN_SHAREWARN = 0

Private Const BIF_RETURNONLYFSDIRS = 1
Private Const BIF_DONTGOBELOWDOMAIN = 2
'Private Const BIF_BROWSEINCLUDEFILES = 4
Private Const MAX_PATH = 260

Private Declare Function SHBrowseForFolder Lib "Shell32" (lpbi As BROWSEINFO) As Long

Private Declare Function SHGetPathFromIDList Lib "Shell32" (ByVal pidList As Long, _
                                  ByVal lpBuffer As String) As Long

Private Declare Function lstrcat Lib "kernel32" Alias "lstrcatA" _
                                  (ByVal lpString1 As String, ByVal _
                                  lpString2 As String) As Long

Private Type BROWSEINFO
   hWndOwner      As Long
   PIDLRoot       As Long
   pszDisplayName As Long
   lpszTitle      As Long
   ulFlags        As Long
   lpfnCallback   As Long
   lParam         As Long
   iImage         As Long
End Type

Public Function API_Getfolder(ByRef pstrFolderName As String, ByVal pstrDialogTitle As String, Optional pbolUseUnc As Boolean = False) As Boolean
'Opens a Treeview control that displays the directories in a computer
'//////////////////////////////////// Error Checking ///////////////////////////////////
On Error GoTo API_Getfolder_Error

'/////////////////////////////////// Declare Constants /////////////////////////////////

'///////////////////////////////// Declare Local Variables /////////////////////////////
Dim lpIDList As Long
Dim strFolder As String
Dim szTitle As String
Dim tBrowseInfo As BROWSEINFO
Dim strSavefolder As String
'//////////////////////////////////// Message Strings //////////////////////////////////

'////////////////////////////////////// Main Program ///////////////////////////////////
'Assume the Worst
API_Getfolder = False
strSavefolder = CurDir()

szTitle = pstrDialogTitle
strFolder = pstrFolderName
If Len(pstrFolderName) > 0 Then
   
End If
With tBrowseInfo
    .hWndOwner = Frog_GetActiveWindow()
    .lpszTitle = lstrcat(szTitle, "")
'    .pIDLRoot = lstrcat(strFolder, "")
    .ulFlags = BIF_RETURNONLYFSDIRS + BIF_DONTGOBELOWDOMAIN '+ BIF_BROWSEINCLUDEFILES
End With

lpIDList = SHBrowseForFolder(tBrowseInfo)

If (lpIDList) Then
    strFolder = Space(MAX_PATH)
    SHGetPathFromIDList lpIDList, strFolder
    strFolder = Left(strFolder, InStr(strFolder, vbNullChar) - 1)
    If Right(strFolder, 1) <> "\" Then
        strFolder = strFolder & "\"
    End If
   
    If pbolUseUnc Then
        pstrFolderName = GetUNCPath(strFolder)
    Else
        pstrFolderName = strFolder
    End If
    API_Getfolder = True
End If
'///////////////////////////////////// End Of Program //////////////////////////////////
API_Getfolder_Exit:
On Error Resume Next
ChDir strSavefolder
        Exit Function
'///////////////////////////////////// Error Handling /////////////////////////////////
API_Getfolder_Error:
'// Display message number and text
Beep
MsgBox Err & vbCrLf & Error, 48, "Error in API_Getfolder"
Call ErrorLog(Err, Error, mcstrModule, "API_Getfolder")
'Resume '***Delete
Resume API_Getfolder_Exit
End Function


Function api_GetDataFile(pstrFileName As String, pstrType As String, pstrDialogTitle As String, Optional pbolUseUnc As Boolean = True) As Boolean
'//////////////////////////////////// Error Checking ///////////////////////////////////
On Error GoTo API_GetDataFile_Error

'/////////////////////////////////// Declare Constants /////////////////////////////////

'///////////////////////////////// Declare Local Variables /////////////////////////////
Dim CMDLG_OPENFILENAME As CES_OPENFILENAME
Dim strMessage As String, strFilter As String, strFileName As String
Dim strFileTitle As String, strDefExt As String, strTitle As String, strMsg As String
Dim strCRLF As String, strSzCurDir As String, lngAPIResults As Long, intInput As Integer
Dim intX As Integer, strSysFileID As String, strPath As String
Dim strDrive As String
'//////////////////////////////////// Message Strings //////////////////////////////////

'////////////////////////////////////// Main Program ///////////////////////////////////
'
' assume the worst
api_GetDataFile = False

'strPath = pstrFileName

strCRLF = Chr$(13) & Chr$(10)

    '*Define the filter string and allocate space in the "c" string
    If pstrType = "dbf" Then
        strFilter = "DBase iv (*.dbf)" & Chr(0) & "*.DBF" & Chr(0)
    ElseIf pstrType = "mdb" Then
        strFilter = "Access (*.mdb)" & Chr(0) & " *.MDB" & Chr(0)
    ElseIf pstrType = "txt" Then
        strFilter = "Text" & Chr(0) & "*.TXT" & Chr(0)
        strFilter = strFilter & "Comma Seperated" & Chr(0) & "*.csv" & Chr(0)
    ElseIf pstrType = "dot" Then
        strFilter = "Word Template" & Chr(0) & " *.Dot" & Chr(0)
    ElseIf pstrType = "xls" Then
        strFilter = "Excel file" & Chr(0) & "*.xls" & Chr(0)
    ElseIf pstrType = "xlt" Then
        strFilter = "Excel Template" & Chr(0) & "*.xlt" & Chr(0)
    Else
        strFilter = pstrType & " Files" & Chr(0) & "*." & pstrType & Chr(0)
    End If
   
    strFilter = strFilter & "All Files (*.*)" & Chr(0) & "*.*" & Chr(0) & Chr(0)


    '* Allocate string space for the returned strings.
If Len(pstrFileName) > 0 Then
    strPath = GetFilePath(pstrFileName)
   
    strFileName = Right(pstrFileName, (Len(pstrFileName) - Len(strPath)))
    strFileName = strFileName & Space$(255 - Len(strFileName)) & Chr$(0)
Else
    strFileName = Chr$(0) & Space$(255) & Chr$(0)
End If
    strFileTitle = Chr$(0) & Space$(255) & Chr$(0)

    '* Give the dialog a caption title.
    strTitle = pstrDialogTitle & Chr$(0)

    '* Set up the default directory

If Len(strPath) = 0 Then
    strSzCurDir = Chr(0) & strPath & Chr$(0)
Else
    strSzCurDir = strPath & Chr$(0)
End If

    '* Set up the data structure before you call the GetOpenFileName

    CMDLG_OPENFILENAME.lStructSize = Len(CMDLG_OPENFILENAME)
    CMDLG_OPENFILENAME.hWndOwner = Frog_GetActiveWindow()
    CMDLG_OPENFILENAME.hInstance = 0
'    CMDLG_OPENFILENAME.lpstrFilter = Mylstrcpy(strFilter, strFilter)
    CMDLG_OPENFILENAME.lpstrFilter = strFilter
    CMDLG_OPENFILENAME.lpstrCustomFilter = vbNullString
    CMDLG_OPENFILENAME.nMaxCustFilter = 0
    CMDLG_OPENFILENAME.nFilterIndex = 1
    CMDLG_OPENFILENAME.lpstrFile = strFileName
    CMDLG_OPENFILENAME.nMaxFile = Len(strFileName)
    CMDLG_OPENFILENAME.lpstrFileTitle = strFileTitle
'    CMDLG_OPENFILENAME.lpstrFileTitle = Mylstrcpy(strFileTitle, strFileTitle)
    CMDLG_OPENFILENAME.nMaxFileTitle = Len(strFileTitle)
'    CMDLG_OPENFILENAME.lpstrInitialDir = Mylstrcpy(strSzCurDir, strSzCurDir)
    CMDLG_OPENFILENAME.lpstrInitialDir = strSzCurDir
'    CMDLG_OPENFILENAME.lpstrTitle = Mylstrcpy(strtitle, strtitle)
    CMDLG_OPENFILENAME.lpstrTitle = strTitle
    CMDLG_OPENFILENAME.Flags = CMDLG_OFN_FILEMUSTEXIST Or CMDLG_OFN_READONLY
'    CMDLG_OPENFILENAME.lpstrDefExt = Mylstrcpy(strDefExt, strDefExt)
    CMDLG_OPENFILENAME.lpstrDefExt = strDefExt
    CMDLG_OPENFILENAME.nFileOffset = 0
    CMDLG_OPENFILENAME.nFileExtension = 0
    CMDLG_OPENFILENAME.lCustData = 0
    CMDLG_OPENFILENAME.lpfnHook = 0
    CMDLG_OPENFILENAME.lpTemplateName = vbNullString

    '* This will pass the desired data structure to the Windows API,
    '* which will in turn use it to display the Open Dialog form.

    lngAPIResults = MyGetOpenFileName(CMDLG_OPENFILENAME)

    If lngAPIResults <> 0 Then
        strFileName = CMDLG_OPENFILENAME.lpstrFile
       strFileName = Left$(strFileName, InStr(strFileName, Chr$(0)) - 1)
       If pbolUseUnc Then
       pstrFileName = GetUNCPath(strFileName)
       Else
       pstrFileName = strFileName
       End If
    Else
        GoTo API_GetDataFile_Exit
    End If
   
API_GetDataFile_Success:
api_GetDataFile = True
'///////////////////////////////////// End Of Program //////////////////////////////////
API_GetDataFile_Exit:
    On Error Resume Next

   Exit Function

'///////////////////////////////////// Error Handling /////////////////////////////////
API_GetDataFile_Error:
'// Display message number and text
   Beep
   If Err = 68 Then
      MsgBox ("Unable to connect to network drive.. Please contact your system administrator."), 64, ("Drive Error")
   Else
      MsgBox Err & Chr$(13) & Error, 48, "Error in API_GetDataFile"
   End If
   Resume API_GetDataFile_Exit

End Function
Function api_SaveDataFile(pstrFileName As String, pstrType As String, pstrDialogTitle As String, Optional pbolUseUnc As Boolean = True) As Boolean
'//////////////////////////////////// Error Checking ///////////////////////////////////
On Error GoTo API_SaveDataFile_Error

'/////////////////////////////////// Declare Constants /////////////////////////////////

'///////////////////////////////// Declare Local Variables /////////////////////////////
Dim CMDLG_OPENFILENAME As CES_OPENFILENAME
Dim strMessage As String, strFilter As String, strFileName As String
Dim strFileTitle As String, strDefExt As String, strTitle As String, strMsg As String
Dim strCRLF As String, strSzCurDir As String, lngAPIResults As Long, intInput As Integer
Dim intX As Integer, strSysFileID As String, strPath As String
Dim strDrive As String
'//////////////////////////////////// Message Strings //////////////////////////////////

'////////////////////////////////////// Main Program ///////////////////////////////////
'
' assume the worst
api_SaveDataFile = False

strPath = pstrFileName

strCRLF = Chr$(13) & Chr$(10)

    '*Define the filter string and allocate space in the "c" string
    If pstrType = "dbf" Then
        strFilter = "DBase iv (*.dbf)" & Chr(0) & "*.DBF" & Chr(0)
    ElseIf pstrType = "mdb" Then
        strFilter = "Access (*.mdb)" & Chr(0) & " *.MDB" & Chr(0)
    ElseIf pstrType = "txt" Then
        strFilter = "Text" & Chr(0) & "*.TXT" & Chr(0)
        strFilter = strFilter & "Comma Seperated" & Chr(0) & "*.csv" & Chr(0)
    ElseIf pstrType = "Doc" Then
        strFilter = "Word Document" & Chr(0) & "*.DOC" & Chr(0)
        strFilter = strFilter & "RTF" & Chr(0) & "*.rtf" & Chr(0)
    ElseIf pstrType = "xls" Then
        strFilter = "Excel Workbook" & Chr(0) & "*.xls" & Chr(0)
    Else
        strFilter = pstrType & " Files" & Chr(0) & "*." & pstrType & Chr(0)
    End If
    strDefExt = pstrType & Chr$(0)
   
    strFilter = strFilter & "All Files (*.*)" & Chr(0) & "*.*" & Chr(0) & Chr(0)

    '* Allocate string space for the returned strings.
If Len(pstrFileName) > 0 Then
'    strPath = pstrFileName
    strPath = GetFilePath(pstrFileName)
    strFileName = Right(pstrFileName, (Len(pstrFileName) - Len(strPath)))
    strFileName = strFileName & Space$(255 - Len(strFileName)) & Chr$(0)
Else
    strFileName = Chr$(0) & Space$(255) & Chr$(0)
End If
    strFileTitle = Chr$(0) & Space$(255) & Chr$(0)

    '* Give the dialog a caption title.
    strTitle = pstrDialogTitle & Chr$(0)

    '* Set up the default directory

If Len(strPath) = 0 Then
    strSzCurDir = Chr(0) & strPath & Chr$(0)
Else
    strSzCurDir = strPath & Chr$(0)
End If

    '* Set up the data structure before you call the GetOpenFileName

    CMDLG_OPENFILENAME.lStructSize = Len(CMDLG_OPENFILENAME)
    CMDLG_OPENFILENAME.hWndOwner = Frog_GetActiveWindow()
    CMDLG_OPENFILENAME.hInstance = 0
    CMDLG_OPENFILENAME.lpstrFilter = strFilter
    CMDLG_OPENFILENAME.lpstrCustomFilter = vbNullString
    CMDLG_OPENFILENAME.nMaxCustFilter = 0
    CMDLG_OPENFILENAME.nFilterIndex = 1
    CMDLG_OPENFILENAME.lpstrFile = strFileName
    CMDLG_OPENFILENAME.nMaxFile = Len(strFileName)
    CMDLG_OPENFILENAME.lpstrFileTitle = strFileTitle
    CMDLG_OPENFILENAME.nMaxFileTitle = Len(strFileTitle)
    CMDLG_OPENFILENAME.lpstrInitialDir = strSzCurDir
    CMDLG_OPENFILENAME.lpstrTitle = strTitle
    CMDLG_OPENFILENAME.Flags = CMDLG_OFN_PATHMUSTEXIST Or CMDLG_OFN_READONLY Or CMDLG_OFN_OVERWRITEPROMPT
    CMDLG_OPENFILENAME.lpstrDefExt = strDefExt
    CMDLG_OPENFILENAME.nFileOffset = 0
    CMDLG_OPENFILENAME.nFileExtension = 0
    CMDLG_OPENFILENAME.lCustData = 0
    CMDLG_OPENFILENAME.lpfnHook = 0
    CMDLG_OPENFILENAME.lpTemplateName = vbNullString

    '* This will pass the desired data structure to the Windows API,
    '* which will in turn use it to display the Open Dialog form.

    lngAPIResults = MyGetSaveFileName(CMDLG_OPENFILENAME)

    If lngAPIResults <> 0 Then
        strFileName = CMDLG_OPENFILENAME.lpstrFile
       strFileName = Left$(strFileName, InStr(strFileName, Chr$(0)) - 1)
       If pbolUseUnc Then
        pstrFileName = GetUNCPath(strFileName)
        pstrFileName = strFileName
        End If
    Else
        GoTo API_SaveDataFile_Exit
    End If
   
API_SaveDataFile_Success:
api_SaveDataFile = True
'///////////////////////////////////// End Of Program //////////////////////////////////
API_SaveDataFile_Exit:
    On Error Resume Next

   Exit Function

'///////////////////////////////////// Error Handling /////////////////////////////////
API_SaveDataFile_Error:
'// Display message number and text
   Beep
   If Err = 68 Then
      MsgBox ("Unable to connect to network drive.. Please contact your system administrator."), 64, ("Drive Error")
   Else
      MsgBox Err & Chr$(13) & Error, 48, "Error in API_SaveDataFile"
   End If
   Resume API_SaveDataFile_Exit

End Function

Private Function GetUNCPath(ByVal strPath As String) As String
'Note, this function will only return the UNC for network drives.
'Non-net drives and errors get the original value returned to them
On Error GoTo Err_GetUNC
    Const lngcBuffer As Long = 257
    Dim strUNCPath As String
    Dim strDrive As String
    If Left(strPath, 2) Like "[a-z, A-Z]:" Then
        strDrive = Left(strPath, 2)
        strUNCPath = strUNCPath & Space(lngcBuffer)
        'The function will automatically fill the strUNCPath unless there
        'is an error (return<>0), fill strPath if error
        If apiWNetGetConnection(strDrive, strUNCPath, lngcBuffer) = 0 Then
            strUNCPath = TrimNull(strUNCPath) & Mid(strPath, 3)
        Else
            strUNCPath = strPath
        End If
    End If
    If Len(Trim(strUNCPath)) = 0 Then strUNCPath = strPath
    GetUNCPath = strUNCPath
Exit_GetUNC:
    Exit Function
Err_GetUNC:
    MsgBox "Error " & Err.Number & " " & Err.Description
    Resume Exit_GetUNC
End Function

Private Function TrimNull(ByVal strNullTermString As String) As String
'This function is used to return a string from a DLL null-terminated string
On Error GoTo Err_TrimNull
    Dim lngNullPos As Long
    lngNullPos = InStr(strNullTermString, vbNullChar)
    If lngNullPos > 0 Then
        TrimNull = Left(strNullTermString, lngNullPos - 1)
    Else
        TrimNull = strNullTermString
    End If
Exit_TrimNull:
    Exit Function
Err_TrimNull:
    MsgBox "Error " & Err.Number & " " & Err.Description
    Resume Exit_TrimNull
End Function
Public Function GetFilePath(ByVal pstrFileName As String) As String
Dim intX As Integer, intY As Integer
Dim strPath As String
intX = 1
intX = InStr(intX, pstrFileName, "\")

Do While intX > 0
    strPath = Left(pstrFileName, intX)
    intX = InStr(intX + 1, pstrFileName, "\")
Loop
GetFilePath = strPath
End Function
0
 
LVL 54

Expert Comment

by:nico5038
ID: 7183041

No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in Community Support that this question is:
 - PAQ'd and pts refunded
Please leave any comments here within the
next seven days.

PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER !

Nic;o)
0
 
LVL 5

Accepted Solution

by:
Netminder earned 0 total points
ID: 7199461
Per recommendation, points NOT refunded and question closed.

Netminder
CS Moderator
0

Featured Post

NFR key for Veeam Agent for Linux

Veeam is happy to provide a free NFR license for one year.  It allows for the non‑production use and valid for five workstations and two servers. Veeam Agent for Linux is a simple backup tool for your Linux installations, both on‑premises and in the public cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The Windows Phone Theme Colours is a tight, powerful, and well balanced palette. This tiny Access application makes it a snap to select and pick a value. And it doubles as an intro to implementing WithEvents, one of Access' hidden gems.
If you need a simple but flexible process for maintaining an audit trail of who created, edited, or deleted data from a table, or multiple tables, and you can do all of your work from within a form, this simple Audit Log will work for you.
In Microsoft Access, learn how to use Dlookup and other domain aggregate functions and one method of specifying a string value within a string. Specify the first argument, which is the expression to be returned: Specify the second argument, which …
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…

604 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question