First create an Access database, such as psw.mdb, setting the password 12345 for it, set a table USEDB. 1. Establish a new form FORM1, put into a Tadotable control, a TDataSource control, and a TDBGRID control, enter several records. 2. Set the connectionstring property of the Tadotable control to provider = microsoft.jet.Oledb.4.0; data source = psw.mdb; persist security info = false; jet oledb: database password = 12345, note that the password can also click in the build window. "All" (last) tab, find the JET OLEDB: Database Password item in the list below to enter 12345 after opening the 12345 after opening the input box. 3. Set the DataSet property of the TDataSource control to tadotable1. 4. Set the DataSource attribute of the TDBGRID control to TDataSource1. 5. Set the TableName property to usedb, the Active property is TRUE. After the above settings, we will see that the data has been displayed in the TDBGRID control, so we complete access to Access database with ADO to password.
Author: Hu Guangtao
Email / msn: huguangtao0515@hotmail.comqq: 621150