Converting Access 2.0 to Access 2003

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I just converted a legacy Access 2.0 app to Access 2003 (please don't laugh,
yes I am coming out of the dark ages). It compiles with no errors but when I
try to execute the 2003 application, I get the following error: "Unable to
locate CPS Loans .ini file in path 'msacc30.ini' or 'mcacc30.ini'!" CPS
Loans is the name of my application. I can not find much information on the
msacc30.ini file except something about backwards compatability. I am
starting on my Login screen and I am trying to execute from within Access
2003. I want to test my conversion, so I need to be able to execute in
development mode.
 
Here is the batch of code that is executed as the Logon form is opened:

vntReturn = SysCmd(SYSCMD_INIFILE)

If IsNull(vntReturn) Then
MsgBox "Unable to locate CPS Loans .ini file!", MB_IconStop, MB_TITLE
Exit Function
End If

sIni = Trim(vntReturn)
'
' Check that the .ini file exists where it is expected to be
'
On Error Resume Next

sReturn = Dir(sIni)

If IsNotValid(sReturn) Then
iReturn = GetWindowsDirectory(sWinDir, 20)
If iReturn > 0 Then
sIni = Left(sWinDir, iReturn) & "\" & fnGetFileName(sIni)
sReturn = Dir(sIni)
End If
End If

If IsNotValid(sReturn) Then
MsgBox "Unable to locate CPS Loans .ini file in path '" &
Trim(vntReturn) & "' or '" & sIni & "' !", MB_IconStop, MB_TITLE
Else
fnGetIniPath = sIni
End If

The SysCmd call returns a value of 8, so the next set of statements does not
get executed.

When the sReturn = Dir(sIni) line of code gets executed, it is trying to
find the directory of the ‘msacc30.ini’ file, and it can not.

On the next block of code, If IsNotValid(sReturn) Then, the variable sReturn
does not return a valid value.

The variable iReturn does not return a value greater than 0, so it ends up
being invalid for the next block of code. This is when I start getting the
message boxes that I referenced in the original message and the app
eventually stops working.

I hope this makes sense to you.

This is weird…
I went back to the original Access 2.0 app to compare the values of the
variables to what is returned from Access 2003. In Access 2.0, I get the
path to the .ini file that the orignal group of developers set up (not a
Microsoft file). In Access 2003, it is trying to find the ‘msacc30.ini’ file.

If I set the value of vntReturn in Access 2003 to what is returned in Access
2.0, the code works.

Talk about too much drama…
 
SYSCMD_INIFILE is a value of 8
SysCmd(SYSCMD_INIFILE) returns a value of msacc30.ini

For backwards compatibility between A95 and A2.0, there
was a /INI command line parameter. I have no idea if it
is still supported or just ignored.

Since nothing else is using msacc30.ini, you could just
rename your application ini file msacc30.ini and see how
far you get.

The ini file would have originally contained pointers
to any wizards or references and to any security workgroup.
You need to examine the original ini file and see what
it contains. That part of the functionality of the ini
file can be replaced with registry settings, command
line parameters, and references.

Other entries in the ini file probably will continue
to work, but will be written to/read from the registry.
I think that Access 2.0 used 'GetSetting' to get settings
from the ini file. If not, you will have to replace any
code which gets settings from the ini file with calls
to 'GetSetting'.

Then you will be able to just delete the code which checks
for the location of the ini file.

(david)
 
Back
Top