473,499 Members | 1,568 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to Read a Config File in Access

24 New Member
Hello,

New to Access and I need to know how can I do this.

I need to read a Config file and use that in my Access Code.

I tried to look up in the MSDN for objects like Open, Read in Access but couldn't find anything about "Read"

For Ex:

Dim FilePath as string
FilePath = Access.CurrentDB.Name + "ConfigFile.txt"

Open FilePath FOR INPUT as #FilePath

Now I am not sure how can I read. I am struck with Syntax and couldn't find any relevant documentation.

Can some one answer this please.

Thanks,
YMK
Nov 27 '06 #1
2 5798
PEB
1,418 Recognized Expert Top Contributor
Hello,

New to Access and I need to know how can I do this.

I need to read a Config file and use that in my Access Code.

I tried to look up in the MSDN for objects like Open, Read in Access but couldn't find anything about "Read"

For Ex:

Dim FilePath as string
FilePath = Access.CurrentDB.Name + "ConfigFile.txt"

Open FilePath FOR INPUT as #FilePath

Now I am not sure how can I read. I am struck with Syntax and couldn't find any relevant documentation.

Can some one answer this please.

Thanks,
YMK
To get the lines from the file try:

Dim FilePath as string
FilePath = Access.CurrentDB.Name + "ConfigFile.txt"

Open FilePath FOR INPUT as #1
do while not eof(1)
Input #1, myline
process my line
loop
Close #1

but it depends on what kind of config file is yours... There is stored things about the ini files i think! Sure that there is something in VB but in Access never tried for the ini's

If your config.txt is plain usual text u can open the file and get the data using this algo..
Nov 27 '06 #2
ymk
24 New Member
To get the lines from the file try:

Dim FilePath as string
FilePath = Access.CurrentDB.Name + "ConfigFile.txt"

Open FilePath FOR INPUT as #1
do while not eof(1)
Input #1, myline
process my line
loop
Close #1

but it depends on what kind of config file is yours... There is stored things about the ini files i think! Sure that there is something in VB but in Access never tried for the ini's

If your config.txt is plain usual text u can open the file and get the data using this algo..
Thank You. It worked.
Nov 27 '06 #3

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

Similar topics

5
2375
by: Karthikesh Raju | last post by:
Hi All, i am wondering about the best way to read in a configuration file that goes like: ########### source_dir = '/home/karthik/Projects/python' data_dir =...
3
2567
by: Mustaq | last post by:
Hi, How to read same config file from different application? I have 4 application in VB.NET, all are using different app.config files. NOW I need all to read only one config file, how can I do...
1
2975
by: Brian Patterson | last post by:
Hi - I'm trying to manually read and parse Machine.Config. When I try this I recieve the following error: Access to the path "C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\" is denied. I am...
4
2981
by: Chris V | last post by:
I'm having a problem deploying my ASP.NET application to a WIN2k server. (IIS5 .NET 1.1) When I try to access ConfigurationSettings.AppSettings("WhateverValue") I get an "Object reference not...
10
2517
by: NuB | last post by:
I'm creating a C# class file(DLL) that will be used by an asp.net application. In the DLL I want to read a web.config, or app.config file so some information can change without having to go into...
5
2269
by: Sridhar | last post by:
Hi, I have created a project which contains classes to read the data from the database. This project has an App.Config file which contains the SqlConnection String. when this code is called from...
4
2294
by: klynn | last post by:
Hi: I'm having problems reading a Microsoft Access file from my ASP.Net app on a Windows Server 2003 machine. The error message: The Microsoft database engine cannot open the file, <my_file>. It...
9
4256
by: =?Utf-8?B?TWlrZQ==?= | last post by:
Hi. Is it programatically possible in VB.NET to read the contents of web.config's <customErrorselement? I looked at using ConfigurationSettings.AppSettings, but that doesn't work. I need to...
12
13406
by: dbuchanan | last post by:
Hello, (Is this the proper newsgroup?) === Background === I am building a solution with two projects. One project is my data access layer which contains my DataSet as an xsd file. The XSD...
0
7132
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
7009
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7178
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
6899
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
7390
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5475
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
4919
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
3103
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
302
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.