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 controlsCodePudding user response:
Directly using ado bde or dbexpress components is very easy and convenientCodePudding 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