473,472 Members | 1,717 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

VB6: Create ini file on the fly

2 New Member
My VB6 application needs the ability to create custom "config" files on the fly.

I.e. form field values need to be saved to this config file for later use.

I've found plenty of code for reading/writing to INI files which seems to meet my needs in terms of saving the custom configs.

However ... the INI file already needs to exist for this to work.

How can I create a new blank INI file on the fly?

TIA.

Code, eg:

' get filepath
strFilePath = App.Path & "\config\" & strReportName & ".ini"

' check if ini file exists already
If Not (Dir(strFilePath) <> "") Then
'create ini file

End If
Apr 1 '09 #1
1 5830
TUSSFC
2 New Member
Doh ... I assumed you couldn't use FSO to create INI files, but you can.

Set objFSo = CreateObject("Scripting.FileSystemObject")
Set objFileNew = objFSo.CreateTextFile(App.Path & "\config\" & strReportName & ".ini", ForWriting)
objFileNew.Close
Apr 1 '09 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Markus | last post by:
hi ng, i've declared some com-objects from vb6 in my asp.net project in the global.asax file. (with text editor because vs.net only opens the code behind file...) like <object...
16
by: Ben Hannon | last post by:
Hi, I'm writting a COM Class in VB.NET to be used in a VB6 project (Tired of the VB6 hassles with cloning and serializing an object). All my classes I need cloneable/serializable are now in a...
5
by: Eric Fortin | last post by:
I'm trying to create a classlibrary in VB.net and call it from VB6. I can't figure it out. I created a .net project Created a proc DoSomething Sub DoSOmething() msgbox ("You did...
13
by: Metallicraft | last post by:
I have a vb6 application. On the main form is a picture box with one or two images and several pieces of text displayed in it. These are created on the fly using gdi32 routines that are all in a...
0
by: HKSHK | last post by:
This list compares the error codes used in VB.NET 2003 with those used in VB6. Error Codes: ============ 3: This Error number is obsolete and no longer used. (Formerly: Return without GoSub)...
9
by: Terry | last post by:
I am converting (attempting) some vb6 code that makes vast use of interfaces. One of the major uses is to be able to split out Read-only access to an obect. Let me give you a simple (contrived)...
2
by: Mike Sharpe | last post by:
We have many old COM classes that are still in use. They were written in VB6. We are now starting to do some things in C# however we cannot just throw away everything from COM and start over. ...
13
by: Wog George | last post by:
I need to create an EXE that is truly "standalone". By that, I mean the executable file is all that's required for the application to run. My app has a button that fires up a common control (to...
0
by: gunimpi | last post by:
http://www.vbforums.com/showthread.php?p=2745431#post2745431 ******************************************************** VB6 OR VBA & Webbrowser DOM Tiny $50 Mini Project Programmer help wanted...
9
by: Miro | last post by:
Wondering if anyone here has come up with a different solution than I keep coming back to: Here is a thought and I just can't seem to come up with another solution other than to install my old...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.