Load data from Access file into array of records

I have an Access database file with a number of designated fields, such as name, age, gender, address, telno, etc. and want to import the data into an array of records in a Pascal program.

Is it possible?

Comments

  • : I have an Access database file with a number of designated fields, such as name, age, gender, address, telno, etc. and want to import the data into an array of records in a Pascal program.
    :
    : Is it possible?
    :
    :
    Yes it's possible. A database is nothing more than a list of records. You have to learn the structure of that file before you can read it. Luckily most databases use fixed record lengths, which is indicated in the field definitions. Once you have read that, you know the length of each field, and thus the lengh of the record. If you want to read this one structure, it is easiest to hard-code it into your program.
    If you want to read more different structures, you might need to consider using an Access DB driver instead.
  • : I have an Access database file with a number of designated fields, such as name, age, gender, address, telno, etc. and want to import the data into an array of records in a Pascal program.
    :
    : Is it possible?


    If you can't find the format online, I like to use a text editer and look for the first record I recognize and make it a new line. Then look for the Next one and make it a line. Do this with 4-10 records and see if they are all the same length (remember that most editors will show TABs as 3-5 characters instead of 1, so if one or two records seem longer that's probably why).

    Once you know how long each record is, it's just a matter of finding out how far into the file it is and how long each segment is (Name, Age, etc)

    Phat Nat

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories