delphi local Access database connection

  1. Open delphi 7 development tools, the default window has a new project.

     

  2.  In the toolbar, switch to the "ADO" select a card, find the "ADOConnection" component icon, double-click Add Form to the form, the custom name.  
  3. Double-click Form form ADOConnection1 control to open the connection string ADOConnection configuration window. As shown, click on the "Build ......" button.

     

     

  4.  In the "Data Link Properties", according to the type of database connection, a database connection select the appropriate driver. To directly connected to access the database, select the "Jet 4.0 OLE DB Provider", connect SQL server database, choose "OLE DB Provider for SQL Server", if the oracle database, choose "OLE DB Provider for Oracle" (this if no need to separately install the driver). Here the connection database access, selected as shown below, click on "Next"

     

     

  5.  In the "Connections" tab, open the local database access, test the connection

     

     

  6.  Click "OK" to return to ADOConnection connection string configuration window, in the window you can see the connection string has been generated successfully.

     

     

  7.  Then in the Object Inspector (also known as the properties panel), the ADOConnection1 the connected attributes modified to "True", where the user name and password (this is not set to True before each time you connect to the database user password you set people above all to manually enter a user name and password, of course you otherwise, except set in code). delphi successfully establish a connection to the database, and then use ADODataSet, ADOTable other control to operate the database.

Guess you like

Origin www.cnblogs.com/DonVin/p/12195120.html