newbe at vb am an old fortran grammer

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • kimber
    New Member
    • Sep 2006
    • 1

    newbe at vb am an old fortran grammer

    what is some normal code syntax to load an array from my access format (data1 ctl) db?
    this is my first try at vb...i like its construction.

    I generated a db named pooldata.mdb all fields are text.
    thanks in advance!!!
  • miffe
    New Member
    • Sep 2006
    • 7

    #2
    I suggest you open a connection to the database using the data control first of all, then run an SQL command using the recordset property of the data control, with the SQL command you can get a result query of the names or data you need.

    You then can load the info into the array. First of all create the array in the General Declarations part,

    Dim array (idClient, Number, Name)

    then just run a loop to read the data from the SQL result query into the array, I'm not sure of the exact code but it should be generally simple. You could use ADO which would be easier.

    data1.recordset .movefirst
    Do
    data1.recordset .movenext
    'etc
    array (... , ... , ... ) = whatever
    While Data1.EOF = false

    It's quite simple, altough if you want a detailed code I suggest you look for VB/Access tutorials in Google. In my opinion dont use DAO/ADO, use direct SQL queries and the result's to manage your DB.

    Comment

    Working...