Problem writing to an "ini" file in Access 2007

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?
 
S

Stuart McCall

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.
 

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