msvisual.com Forum Index
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Accessing a txt file

 
Post new topic   Reply to topic    msvisual.com Forum Index -> VB DOS
Author Message
Andy G



Joined: 06 Dec 2007
Posts: 1

PostPosted: Thu Dec 06, 2007 3:41 pm    Post subject: Accessing a txt file Reply with quote

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

Archived from group: microsoft>public>vb>dos
Back to top
View user's profile Send private message
ArarghMail712NOSPAM



Joined: 07 Dec 2007
Posts: 1

PostPosted: Thu Dec 06, 2007 10:45 pm    Post subject: Re: Accessing a txt file Reply with quote

On Thu, 6 Dec 2007 10:41:04 -0800, Andy G email_removed wrote:

>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.
Back to top
View user's profile Send private message
Dick Grier



Joined: 04 Oct 2007
Posts: 238

PostPosted: Fri Dec 07, 2007 3:45 pm    Post subject: Re: Accessing a txt file Reply with quote

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.
Back to top
View user's profile Send private message
A. David Garza Marin



Joined: 04 Oct 2007
Posts: 2

PostPosted: Wed Jan 09, 2008 2:53 am    Post subject: Re: Accessing a txt file Reply with quote

"Andy G" escribió en el mensaje de
noticias @microsoft.com...
> 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

Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    msvisual.com Forum Index -> VB DOS All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group