Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

create a text file

Status
Not open for further replies.
Aug 21, 2006
118
US
Hi,

Is it possible to create a text file using some values from an access db? example:

file name: options.ini

[address book sync]
addressbookpath=
[advanced settings]
addressbookpath=
enableoutlooksync=0
minimizeaftersend=1
minimizeonclose=1
[date time]
dateformat=MM-DD-YYYY
timeformat=12 hour
[fax finder device0]
devicetype=FaxFinder
enabled=1
firewall=0
ipaddress=<FILL IN FROM TABLE>
password=<FILL IN FROM TABLE>
username=<FILL IN FROM TABLE>
[fax retry]
retrycount=2
retryinterval=300
retrykilltime=30
[identification]
company=My Company Name
fax_localid=2
fax_num=<FILL IN FROM TABLE>
name=<FILL IN FROM TABLE>
phone_num=<FILL IN FROM TABLE>
[logging options]
save_on_exit=0
trace_level=5
[main]
coverdefault=<FILL IN FROM TABLE>
devicecount=1
version=1
[which server to use]
selected_server=0

Note <FILL IN FROM TABLE> means I want to use access to populate these areas.

Jeremy
 
Is that not good to do with Print#
Code:
Private Sub btnCreateINI_Click()
    Open ("C:\testfile.ini") For Append As 1
    Print #1, Date
    Print #1, Time
    Print #1, Text0
    Print #1, Text2
    Close 1
End Sub


________________________________________________________
Zameer Abdulla
Help to find Missing people
 
Look at the GetPrivateProfileString and WritePrivateProfileString API calls. They are designed to read and write INI files structured in this way.

You could easily construct this file using a FileSystemObject Textstream or Print statements but you will need something like those API calls to read or modify it.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top