RE: Simulating relational database with text files
- From: "anon" <anon@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Sat, 21 May 2005 12:22:01 -0700
Hi,
If you want to store data in a text file then there are Windows API
functions that can be called from Visual Basic. We do this extensively at
work. For example to retrieve data from a .ini file (this is the suffix that
you would use for the text file) you would use the getprivateprofilestring
API. The methodology behind this is very clearly explained from the following
URL :
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/sysinfo/base/getprivateprofilestring.asp.
So you will need to know how to declare and API from visual basic. Plenty of
examples of that on the net.
Also SQL will only work in a relational database environment so if you want
to perform 'inner joins' etc then you will need to consider using arrays or
arrays of types/structures then programatically going through each data array
set you create and then performing logical operations on various values.
Hope this helps....
"SmilingPolitely" wrote:
> For various reasons I would like to have my data stored in two text files.
>
> The data in one file is related to the the data stored in the second
> text file, in a (simulated) one-to-many relationship. One file is
> stocks.txt (ticker, name) and the other stockdata.txt (ticker, date,
> open, high, low, close)
>
> I would like to place a listbox control on my form and have it show the
> results of a query:
>
> SELECT DISTINCT stockdata.ticker, stocks.name FROM stocks.txt INNER JOIN
> stocksdata.txt ON stocks.ticker=stockdata.ticker;
>
> Maybe someone could help me here, maybe suggesting a better way to
> achieve my aims.
>
> Also, how do I update/delete data records in a text file, as if it were
> a database table?
>
> btw - please be gentle. This is my first attempt at VB databases/data
> access etc
>
>
> Thanks in advance
>
.
- Follow-Ups:
- References:
- Simulating relational database with text files
- From: SmilingPolitely
- Simulating relational database with text files
- Prev by Date: Re: Just Curious
- Next by Date: VB6 - How-to print Excel spreadsheet from VB?
- Previous by thread: Simulating relational database with text files
- Next by thread: Re: Simulating relational database with text files
- Index(es):
Relevant Pages
|