Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Modules / DAO / VBA / May 2005

Tip: Looking for answers? Try searching our database.

Access 97 conversion old DLL Entry point

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
L. Sall - 04 May 2005 20:00 GMT
I have recently aquired a project written in Access 97. In the project there
are declares for dll entry point into Access.exe which under XP kick out
errors as not existing. The entry points are:

 accFileExists Lib "msaccess.exe" Alias "#57"
 accFullPath Lib "msaccess.exe" Alias "#58"
 accSplitPath Lib "msaccess.exe" Alias "#59"

Are there replacements in access XP, 2003?  A VB solution I know exists but
is there one in VBA?
Douglas J. Steele - 04 May 2005 22:51 GMT
As undocumented entry points, there's never been any guarantee that they'll
continue to be valid.

If you know a VB solution, why can't you use that in VBA?

Signature

Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)

>I have recently aquired a project written in Access 97. In the project
>there
[quoted text clipped - 8 lines]
> but
> is there one in VBA?
L. Sall - 05 May 2005 01:50 GMT
Not all VB functions work in VBA... I just wanted to know if there are now
Access Replacements or a VBA equiv.  I use VB alot and find thing like
FileExists in VB has given me alot of Grief. I've coded a solution that
doesn't send the end app into fit of silence but I have seen the solution
during developemnet cause my AV to flag illeagle access.  Since this is going
into a less than user environment I just want to be sure the next guy who
needs to modify the code will not have deciper, as I am, someone else's
Undocumented code.  

I did relize the functions were undocumented... that's why I'm here....  It
is pretty easy to guess what they do I just want to know if Access 2000
exposes any functionality that will effectivly replace these.  My goal is to
convert the Access Application not add 100 lines of code just to fix what is
there.   Right now time is not on my side...  I don't do much VBA in access
anymore Just VB.  I was hoping somone might remember of something.

> As undocumented entry points, there's never been any guarantee that they'll
> continue to be valid.
[quoted text clipped - 13 lines]
> > but
> > is there one in VBA?
Douglas J. Steele - 06 May 2005 00:05 GMT
What are the functions supposed to do?

If accFileExists is supposed to indicate whether or not a particular file
exists, Len(Dir(filename)) > 0 will give you that.

You've already been given an equivalent for accSplitPath: what's accFullPath
supposed to be?

Signature

Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)

> Not all VB functions work in VBA... I just wanted to know if there are now
> Access Replacements or a VBA equiv.  I use VB alot and find thing like
[quoted text clipped - 36 lines]
>> > but
>> > is there one in VBA?
david epsom dot com dot au - 05 May 2005 06:28 GMT
Entry points like that were used in Access 2.0 because
Windows 3.1 did not have an API which provided those
functions.  If you don't wish to use VB code, you should
replace them with standard Windows API calls.

AFAIK The Access Application object and the VBA object
don't explicitly have a FullPath or a SplitPath function.

(david)

>I have recently aquired a project written in Access 97. In the project
>there
[quoted text clipped - 8 lines]
> but
> is there one in VBA?
Jeff Conrad - 05 May 2005 06:50 GMT
> I have recently acquired a project written in Access 97. In the project there
> are declares for dll entry point into Access.exe which under XP kick out
[quoted text clipped - 6 lines]
> Are there replacements in access XP, 2003?  A VB solution I know exists but
> is there one in VBA?

Boy does this ever ring a bell!

I ran into almost the exact same issue for an add-in I have been working on.
I was trying to modify some 97 wizard code and ran into several problems
with converting entry points that were dropped in later versions. MVP Dirk
Goldgar was kind enough to piece together some code to do the same thing
as entry point 59. When I'm back down in the office tomorrow I will dig around
and find it for you.

Signature

Jeff Conrad
Access Junkie
Bend, Oregon

Jeff Conrad - 05 May 2005 17:18 GMT
Ok, here is replacement code for Access 97 Entry Point 59,
care of MVP Dirk Goldgar:

'----- start of code -----
Sub SplitPath( _
           ByVal FilePath, _
           ByRef strDrive As String, _
           ByRef strFolder As String, _
           ByRef strFilename As String, _
           ByRef strExtension As String)

   strDrive = fncSplitString(FilePath, ":")
   If Len(FilePath) = 0 Then
       FilePath = strDrive
       strDrive = vbNullString
   End If

   strFolder = StrReverse(FilePath)

   strFilename = fncSplitString(strFolder, "\")
   If Len(strFolder) > 0 Then
       strFolder = StrReverse(strFolder)
   End If

   strExtension = fncSplitString(strFilename, ".")
   If Len(strFilename) = 0 Then
       strFilename = StrReverse(strExtension)
       strExtension = vbNullString
   Else
       strExtension = StrReverse(strExtension)
       strFilename = StrReverse(strFilename)
   End If

End Sub

Function fncSplitString(ByRef SourceString, ByVal Delimiter, _
                       Optional Compare As Integer = vbBinaryCompare) _
       As String

   ' Splits <SourceString> at the first occurrence of
   ' <Delimiter>, returning all characters up to but not
   ' including <Delimiter>, and removing those
   ' characters plus the following <Delimiter> from <SourceString>.  If
   ' <Delimiter> is not found, all of <SourceString> is returned, and
   ' <SourceString> is set to a zero-length string.  The optional
   ' Parameter <Compare> may be specified to control whether a binary
   ' or text comparison is used to search for <Delimiter>, using the
   ' same values as are accepted by the Instr() function.

   Dim lngPos As Long

   lngPos = InStr(1, SourceString, Delimiter, Compare)

   If lngPos = 0 Then
       fncSplitString = SourceString
       SourceString = ""
   Else
       fncSplitString = Left$(SourceString, lngPos - 1)
       SourceString = Mid$(SourceString, lngPos + 1)
   End If

End Function
'----- end of code -----

'Here's a routine to test it out:

'----- start of tester code -----
Sub SplitPathTest()

   Dim strPath As String
   Dim strDrive As String
   Dim strFolder As String
   Dim strFilename As String
   Dim strFileExt As String

   Do
       strPath = InputBox("Enter path to parse:")
       If Len(strPath) > 0 Then
           SplitPath strPath, strDrive, strFolder, _
           strFilename, strFileExt

           MsgBox _
               "drive=" & strDrive & vbCr & _
               "folder=" & strFolder & vbCr & _
               "filename=" & strFilename & vbCr & _
               "extension=" & strFileExt
       Else
           Exit Do
       End If
   Loop

End Sub
'----- end of tester code -------

Dirk Goldgar, MS Access MVP
www.datagnostics.com
(please reply to the newsgroup)

Hope that gets you going,
Signature

Jeff Conrad
Access Junkie
Bend, Oregon

> > I have recently acquired a project written in Access 97. In the project there
> > are declares for dll entry point into Access.exe which under XP kick out
[quoted text clipped - 15 lines]
> as entry point 59. When I'm back down in the office tomorrow I will dig around
> and find it for you.
L. Sall - 05 May 2005 20:21 GMT
Jeff thanks... You would not happen to have replacements on hand for the
other two functions?  

> Ok, here is replacement code for Access 97 Entry Point 59,
> care of MVP Dirk Goldgar:
[quoted text clipped - 115 lines]
> > as entry point 59. When I'm back down in the office tomorrow I will dig around
> > and find it for you.
Jeff Conrad - 06 May 2005 03:10 GMT
> Jeff thanks... You would not happen to have replacements on hand for the
> other two functions?

No, I do have replacements handy.

As Doug has already mentioned, the Len function should help with
finding out if a particular file exists.

Signature

Jeff Conrad
Access Junkie
Bend, Oregon

 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.