Converting Access 2.0 API's

J

Jim

I am trying to convert a (very) old Access 2.0 application
to Access 2002. The former uses the following function

Declare Function GetPrivateProfileString Lib "Kernel"
(ByVal lpApplicationName As String, ByVal lpKeyName As
Any, ByVal lpDefault As String, ByVal lpReturnedString As
String, ByVal nSize As Integer, ByVal lpFileName As
String) As Integer

which is then called in various places throughout the
application eg

lpSection = "Options"
lpEntry = "SystemDB"
lpDefault = ""
Set dbCurrent = DBEngine.Workspaces(0).Databases(0)
GPPSReturnVal = GetPrivateProfileString(lpSection, ByVal
lpEntry, lpDefault, lpReturnVal, BUFSIZE, lpIniName)

The function doesn't exist in Access 2002. The first time
I ran it I got an error as the library KERNEL wasn't
found. I have tried replacing the Lib parameter with
Kernel32 but I still get an error.

I think the function returns the full pathname of the
database (which may be in a different location to the
front end database).

Any ideas?
 
J

JohnFol

It didn't exist in Access 2 either. It was an OS call.
Have a look at Q210115 "How to convet API calls from 16-bit to 32-bit"
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top