Problem writing to an "ini" file in Access 2007

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? 

4/8/2010 9:40:13 PM
access.formscoding 7493 articles. 0 followers. Follow

1 Replies

Similar Articles

[PageSpeed] 6

"LA Lawyer" <> wrote in message 
>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:

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

4/8/2010 9:50:36 PM

Similar Artilces:

Problem with OnInitialUpdate()
Hi all I am making a SDI Application for displaying images(say .bmp). I derived my view class from CScrollView. I Comments following lines in MyView::OnInitialUpdata(). file://CSize sizeTotal; // TODO: calculate the total size of this view // = = 100; // SetScrollSizes(MM_TEXT, sizeTotal) I use a function OnUpdate() in my view class. In this function, i set the view window size according to picture size which i have to display. When i run the program in ReleaseMode, picture is display in view window. If i don't comments above lines in OnInitialUpdate() then i do...

combining certain parts of 2 money files
I have money installed on my laptop and my desktop. I downloaded data from bank several months ago onto laptop and now I need to move to the desktop. (Gone from bank sever) I saw post on combining 2 files, but can you extract only certain tranactions from a certain account and move it to another file? I'm using 2005 premium. ...

Word 2007 Scrolls when Minimized
In Windows 7, when I minimize an open Word 2007 document to the Task Bar (by clicking on the "dash" in the upper right hand corner), and when I then click on the Task Bar to re-display the Word application, my viewing position within the Word document has shifted. (The scroll bar stays in the same spot, but it has usually scrolled out of the visible window.) This happens pratically every time. (Documents having 40 to 60 pages.) Any suggestions on how to fix this? A laptop computer with a Touchpad? Does it still happen is you minimise using Winkey+M? -- Terry Fa...

Boot Ini Problem
Hi, I am getting the following error message: Invalid Boot Ini Booting from C:/Windows So I research this problem and create a new Boot Ini file and when I reboot I still get this error. I have not attempted yet to do a repair using my XP media, is this what I need to do to fix this problem? Or is there a less painful way to fix this? Thank you. Maybe this will help. You will be interested mainly in the Bootcfg command. "AIANDAS" <> wrote in message news:9E04022F-4DC2-...

Initialization file for File Manager
Hey Friends I created a file manager application using CListCtrl. It has 4 columns, 1. File Name 2. Date 3. Description 4. File Path I want to save the new files added to the file manager by user. So that whenever user opens the app, user can see the files selected earlier. I think it can be done using a initialization or text file. Can anyone tell me, how to save and load into a file and then to update the CListCtrl? Thanks in advance Assume a text file. On close, save the list of files as lines in the text file On open, read the text file and add the file descriptions back in....

I run from service process with user rights (when user is logged) and in this process I create socket (CAsyncSocket::Create(port);). And I get WSAEPROVIDERFAILEDINIT error. When I run this process manually everything is ok. What is wrong? There are issues of server privileges involved. One thing you might try is to use other than the LocalService account to run the service. joe On Tue, 11 Oct 2005 17:37:45 +0200, ragi <> wrote: >I run from service process with user rights (when user is logged) and in >this process I create socket (CAsyncSocket::Create(port)...

We were unable to obtain online statements from our brokerage firm (Scottrade), and clicking on the "update internet information" link didn't solve the problem. So, we contacted our brokerage firm and they sent us a new fipartnr.ini for Money 2003 & 2004. (We have Money 2000). I renamed the old file, copied the new file into the same directory, then opened Money. Our version of Microsoft Money 2000 seems unable to read this new file, since it no longer gives me a suggestion for _any_ financial institution when I attempt to add a new account. This makes me wonder, did the...

Combining MS Money files
Is there a way to combine/merge MS Money files (not accounts, but files) into one file that will display all acounts? -- FDR You will have to mentally designate one file as the master file and the export accounts from the other file to qif file format. Then import the files all together (use ctrl + click to select when asked which file to import) into the master file. Take backups of both files before you start! -- Regards Bob Peel, Microsoft MVP - Money For UK tips & fixes see;EN-GB;mny. I do not respond to any emails that I ha...

Problem defining an XSD to validate for overlapping ranges
Hi I have a problem to create an XSD that prevents overlapping ranges. Sample XML: <root> <element LowerLimit="1" UpperLimit="50000"> ..... </element> <element LowerLimit="50001" UpperLimit="250000"> ..... </element> <element LowerLimit="250001" UpperLimit="500000"> ..... </element> ...... </root> <element> is always of the same structure <root> has minOccurs="1" and maxOccurs="unbounded" range1 1 to...

What header files should be included in SCSI miniport driver?
Hi: I am writing a simple SCSI miniport driver for Windows XP, and I have the header files <SCSI.h> and <miniport.h>. But there are errors in <srb.h> during compilitation such as: srb.h(63): error C2061 : syntax error : identifier 'SCSI_PHISYCAL_ADDRESS' srb.h(63): error C2059 : syntax error : ';' srb.h(63): error C2059 : syntax error : ',' srb.h(66): error C2061 : C requires that a struct or union has at least one member And there are huge amount of error, so that the last error i can see is : error C10003 : error count exceeds 100;...

Current BPA apears not to parse boot.ini correctly
Have just run the latest BPA on 2 boxes, it reported "USERVA is set incorrectly" and suggests that put /3GB /USERVA=3030 in boot.ini However in both cases the entires were already there Roga ...

Joining several Word Files together, many times.
I have asked this Q in the programming forum but wonder if there is anyone in this forum that might be able to help. I have 150 sets of 8 documents that I want to join together as efficiently as possible. I.e. I want to join 8 docs together into 1 document and I want to do this 150 times. Many thanks RobbieG Hi Robbie, i know this might not help but its a suggestion. I know that this would be alot of work but if you saved alll 150 files as pdf you might be able to use this website to to convert 8 documents at a time and send it as a pdf and let the person that is getting i...

minimizing problem
for unknown reasons, when I minimize a workbook, it goes down to the left corner as a very small box with nothing but a red X on it. I used to be able to see the name of the workbook, and have a choice to restore, close etc... I am not sure what I have done, but would like the "normal" attributes back. any ideas? thanks Dave When I minimized a worksheet window (within excel), I got the same kind of thing--but I could see more of that minimized box. Any chance you could just drag it to the right a bit to see more of it? I could move it and see/hide more stuff. Dave wrote: >...

Inserting Text From Text File (*.ini)
Currently the code below is used to insert a *.jpg image into my document by using a field from an *.ini file ("addresscolor"); the jpg image has addresses and phone numbers: strOfficeFile = "c:\Program Files\Microsoft Office\Templates\HHSystemFiles\address.ini" strOfficeName = pOffice logofilename = System.PrivateProfileString(strOfficeFile, strOfficeName, "LogoColor") addressfilename = System.PrivateProfileString(strOfficeFile, strOfficeName, "AddressColor") ActiveDocument.Bookmarks("Address").Select Selection....

I get this error about every third time I do the internet updates in Money 2004. "Money encountered an error processing the dowloaded file ('SMRTINET.INI')." Yes the error log mispelled the word downloaded! Anybody have any idea? In, Stephen wrote: >I get this error about every third time I do the internet >updates in Money 2004. "Money encountered an error >processing the dowloaded file ('SMRTINET.INI')." Yes the >error log mispelled the word downloaded! > >Anybody have any idea? Close Money In Inter...

How to find "ServerDN=" for msExtmz.ini? ADSIEdit question
Hi, I understand I would need to edit msExtmz.ini and input the value of "ServerDN=" so that I can run msExtmz.ini and fix the DTS thing on Exchange 2003. I am unsure which object in active directory I should examine in order to get the exact value for ServerDN? The MS article states that I could examine the value of "LegacyExchangeDN". However, from which object I should exame such LegacyExchangeDN? I am trying to do that with ADSIedit. On the ADSIEdit.msc console, I highlight for example my ExchangeClusterName. I right-click properties and I seek the value of &quo...

No Dex.ini in Release 10
What replaced the Dex.ini file in GP release 10? In prior releases, we could copy this file the each user's Citrix profile in order for them to use their default printer. How do we do this in release 10? Hi Elaine I am not running 10 yet but this was taken from a previous post in this group. "The Dex.ini (and other files which need write access) have been moved to a Data folder. This is because under Vista applications normally do not have write access to the Program Files folder and sub folders. The Data folder was created with different permissions to resolve this issue.&...

How to re-assign mini-icons to *.html file types in WinExplorer?
Occasionally the mini icons in front of a files of a certain file type (e.g. all *.html) in Windows Explorer are lost. Instead an ugly dummy icon is shown. How can I re-assign the Internet Explorer typical blue "e" mini icons to them again? Resp. how can I don this in general for a file extension .yyy? Cindy Right click on the file and go to Properties and hit the change button = and then designate the program with which you wish to open the file. steve "Cindy Parker" <> wrote in message = news:4c57d81c$0$6986$

Combining archive files
Still using Money 4 (95 ver). Have about nine years of archived files. Is there a way to combine the archived files into one or two files? Makes it easier to search when one does not remember the year. TIA In, JohnS wrote: >Still using Money 4 (95 ver). Have about nine years of archived files. Is >there a way to combine the archived files into one or two files? >Makes it easier to search when one does not remember the year. Simple answer is no. Complex answer is to open every one of those archived files, export accounts to QIF. Then import into copy of cur...

Money 2007
I cannot get money to add trends for dining out in cash flow. I've tried resetting the cash flow settings to show both necessary and discretionary items. It adds 14 categories as trended, only about 6 of them I actually want. But I still won't add dining out to trends. Is there a way to manually add it? the only way I can figure out how to adjust trended items is if they are already in the list. You can adjust the trended items by right clicking on them when you view the cashflow from the budget screen. It lets you see the transactions and set an amount. On Sep 8, 9:09 pm, ...

Strange problem initialising class members
I have a strange problem initialise base class member variables. I have the following classes: class AFX_EXT_CLASS CChartView : public CAutoScrollView { protected: CChartView( ); CSize m_sizePage; } class CServerChartView : public CChartView { public: CServerChartView( CServerDoc* pDoc ); } CChartView::CChartView( ) { // m_sizePage full of random data m_sizePage = CSize( 0, 0 ); // m_sizePage still full of same random data } CServerChartView::CServerChartView( CServerDoc* pDoc ) : CChartView( ) { // m_sizePage full of random data m_sizePage = CSize( 0, 0...

problem with string begininng with 0
Using xl2002, how can i start with a number string that begins in a 0, and add a number to it. example, the string 08902002. how can i have that number in a cell, and make another cell add 1 to it so it becomes 08902003. or add 3000 to it so it becomes 08905002, or whatever. when i add 1, it drops the leading 0. In most instances, the string begins with a non-zero number, but sometimes it begins in 0, or even 00. Thanks, Tonso Try a custom format of: 00000000 -- HTH, RD ===================================================== Please keep all correspondence within the Group, so all may bene...

"Could not initialize CLR IDispatch error #1029" when opening Outlook 2007
I recently upgraded to Office 2007 and began receiving the following message shortly after. The message appears when opening Outlook. It will go away after clicking and reprompt maybe 10-15 times before finally stopping. "Could not initialize CLR IDispatch error #1029" I am currently running XP PRO w/SP2 and Outlook 2007 build 12.0.4518..1014. I also have BCM with SP 3 installed, but it is not enabled at the moment. Any ideas would help greatly. I have come up empty with my searches. ...

Administrator access lost in CRM 3 on SBS
Hello, I have been using CRM 3 for over a year on SBS 2003 , and something strange has happened suddenly. My AD account has Admin privliges, and I have been using it make changes in the CRM Settings pages. Now I only have read access, but the USERS page says I am still a System Admin. I tried the same with the Domain Admin acount and it does the same. This is the same via accessing it via a browser, a browser on the server, and the server console. I made another AD account, join the Admin group, and was able to change the AD Admin account to this new account in the USERS page, bu...

Deterministic PERSISTENT problem
Hi, I receive the following error when trying to CREATE TABLE: Msg 102, Level 15, State 1, Procedure NEW_tblregister, Line 1 Incorrect syntax near ','. Msg 4936, Level 16, State 1, Line 1 Computed column 'search_sname' in table 'NEW_tblregister' cannot be persisted because the column is non-deterministic. Here is the CREATE TABLE statement: /****** Object: Table [dbo].[tblregister] Script Date: 04/07/2010 16:54:20 ******/ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO SET ANSI_PADDING ON GO CREATE TABLE [dbo].[NEW_tblreg...