Problem writing to an "ini" file in Access 2007

  • Thread starter Thread starter LA Lawyer
  • Start date Start date
L

LA Lawyer

I have been trying to use Access 2007 VBA to write values to an ini file.
Here is my code:

System.PrivateProfileString("OurInformation.ini", TypeOfData, VariableName)
= VariableValue

This works fine in Word 2007 but I keep getting a 429 error in Access
("ActiveX component can't create object").

Why can't I write and read from an ini file in Access when I can in Word?
Should I be using some other code to write/read to an ini file?
 
LA Lawyer said:
I have been trying to use Access 2007 VBA to write values to an ini file.
Here is my code:

System.PrivateProfileString("OurInformation.ini", TypeOfData,
VariableName) = VariableValue

This works fine in Word 2007 but I keep getting a 429 error in Access
("ActiveX component can't create object").

Why can't I write and read from an ini file in Access when I can in Word?
Should I be using some other code to write/read to an ini file?

System.PrivateProfileString is .NET code, which Access doesn't support. It's
native language is VBA, which is much more like Visual Basic Classic.

Try this:

http://www.smccall.demon.co.uk/IniFiles.htm#ReadWrite

Just follow the simple instructions to incorporate it into your database.
 
Back
Top