Discussion:
Accessing a txt file
(too old to reply)
Andy G
2007-12-06 18:41:04 UTC
Permalink
Hi All,

I have a database that is in a txt file format what I need to know is HOW do
I access it with VBDOS and HOW do I search it?

I am use to using VB6 and I can easy conect to the Database.

If someone could help I would be very greatfull

Andy
A***@NOT.AT.Arargh.com
2007-12-06 23:45:25 UTC
Permalink
On Thu, 6 Dec 2007 10:41:04 -0800, Andy G <Andy
Post by Andy G
Hi All,
I have a database that is in a txt file format what I need to know is HOW do
I access it with VBDOS and HOW do I search it?
I am use to using VB6 and I can easy conect to the Database.
If someone could help I would be very greatfull
Read up on OBDC.

It's supposed to be able to talk to text files.
--
ArarghMail712 at [drop the 'http://www.' from ->] http://www.arargh.com
BCET Basic Compiler Page: http://www.arargh.com/basic/index.html

To reply by email, remove the extra stuff from the reply address.
Dick Grier
2007-12-07 17:45:21 UTC
Permalink
Hi,

You can open the file for Input (look up OPEN in Help). Then, read in
strings. If you INPUT#x, MyVar -- MyVar will contain the data for one line
of text from the file. You then parse out the individual elements, based on
the format in the line, into separate element variables.

You also might be abe to open the file as Random, and read in (use GET#) a
TYPE that you define that represents the actual structure.

All of this depends on the details of the file structure.

I suspect that there may be some examples online. Ethan Winer wrote some
rather complex DB code (about 20 years ago, for an earlier version of BASIC)
that might apply. Ethan visits here from time to time. Take a look at
www.ethanwiner.com to see if he has some example code there.

Dick
--
Richard Grier, MVP
Hard & Software
Author of Visual Basic Programmer's Guide to Serial Communications, Fourth
Edition,
ISBN 1-890422-28-2 (391 pages, includes CD-ROM). July 2004, Revised March
2006.
See www.hardandsoftware.net for details and contact information.
A. David Garza Marin
2008-01-09 03:53:19 UTC
Permalink
Post by Andy G
Hi All,
I have a database that is in a txt file format what I need to know is HOW do
I access it with VBDOS and HOW do I search it?
I am use to using VB6 and I can easy conect to the Database.
If someone could help I would be very greatfull
To access it through VB6, you can use a class I did to ease text files data
access. If you don't have so much problems with spanish, then you can
understand easily how to use it. If you don't understand spanish, you maybe
need to grab a translator (such as http://babelfish.altavista.com) to
understand the manual:

http://www.pro-3.com.mx/archivos/archivos.zip

To access it through VB-DOS, you need to use the OPEN filename FOR INPUT AS
#filenumber statement. Surely you will see deep documentation about it in
VB-DOS...
--
Tron.BAS

From the guts of progralogic and mechatronics
Loading...