Home > Back-end >  Using DAO3.6 Access Access
Using DAO3.6 Access Access

Time:10-05

Hello, everyone, I am a novice, has just started to learn c + + builder, consult everybody has a problem, the trouble to give directions, the younger brother to thank you,
Have a Access database, table table1, table has two columns name, password.
Excuse me, how can I read out the values in the table?
I try to write the program as follows,
The Variant theDAO;
The Variant theDB;
The Variant theTable.
TheDAO=the Variant: : CreateObject (" DAO. DBEngine. 36 ");
TheDB=theDAO. Exec (Function (" OpenDatabase ") & lt; <"D: 1. The MDB");
TheTable=theDB. Exec (Function (" OpenRecordSet ") & lt; <"Table1");
While (bool (theTable. Exec (PropertyGet (EOF)))==false)
{
.
TheTable. Exec (Procedure (" MoveNext "));
}
TheTable. Exec (Procedure (" Close "));
Is how to write in the loop, can read out the value of each column in each record?

CodePudding user response:

You can't use adoquery controls

CodePudding user response:

Directly using ado bde or dbexpress components is very easy and convenient

CodePudding user response:

The Variant theDAO;
The Variant theDB;
The Variant theTable.
TheDAO=the Variant: : CreateObject (" DAO. DBEngine. 36 ");
TheDB=theDAO. Exec (Function (" OpenDatabase ") & lt; <"D: 1. The MDB");
TheTable=theDB. Exec (Function (" OpenRecordSet ") & lt; <"Table1");
While (bool (theTable. Exec (PropertyGet (EOF)))==false)
{
theTable. Exec (Function (" field name "));
TheTable. Exec (Procedure (" MoveNext "));
}
TheTable. Exec (Procedure (" Close "));

CodePudding user response:

DAO is the official Microsoft 10 years ago (or earlier) is to determine the things I give up,,,
The building with the method of the second floor,,,,

CodePudding user response:

- use ADO controls
  • Related