RE: Simulating relational database with text files

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



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
>
.



Relevant Pages

  • Re: [PATCH] Add MAXCPU as a kernel config option and quality discussion on this
    ... #ifdef MAXCPU ... the dependency on the options header and show that it is nearely 100% ... There can be no structs or arrays with fixed sizes, ... API never involve fixed sizes (it uses either kmem pointer to the ...
    (freebsd-arch)
  • Re: SMLNJ and 2d arrays, sml and 3d arrays
    ... I have started looking through the mlton ... code to see how the 2d arrays are implemented. ... it could be worth exposing the index computation in ... Stephen> the API so that you can manually avoid repeating it. ...
    (comp.lang.functional)
  • Re: Accessing Cell Arrays from a .MAT file in C#
    ... on both MX arrays and MAT ... TMW provides Windows DLLs that implement APIs for working with MAT ... M-scripts to do what you want, and have the server execute them. ... P/Invoke and the API. ...
    (comp.soft-sys.matlab)
  • Re: GetAdaptersInfo API & Windows ME
    ... Here's an "alternate" method of calling the API using byte arrays rather ... than strings as per the KB article. ... I get the correct information on 2K and XP, but not Windows ME even though ...
    (microsoft.public.vb.winapi)
  • Re: 3vl 2vl and NULL
    ... > or API to the stored data is of primarily interest to me. ... >> designers are capable of defining the world for application programmers, ... I am more of an end-user (aka developer) looking to those ... But building an enterprise database is a lot more than succeeding at a lot ...
    (comp.databases.theory)