Access Operation Using ADOX and OleDb(C#操作Access数据库)

  Now, we are talking something about Office Access(2007) operation using C#. And I will show you how to create a access db file, including creating new table, insert and update data item. Before we start coding, we should add references "Microsoft ADO Ext. 2.8 for DDL and Security" and "Microsoft ActiveX Data Objects 2.8 Library", and of course the related namespace.

  1. Create new Access database using ADOX:

Create Database Using ADOX

  2. Next we will create a new table with several columns for this database, first we try to use ADOX:

Create Table Using ADOX

  3. And we can also use OleDb command to create new table, let's have a look:

Create Table Using OleDb Command

  4. Following are 'insert', 'query', 'update' and 'delete' operations:

Query And Update Using OleDb Command

 

I have already had a test for all the functions, if you get any problem please let me know.

 

Go to my home page for more posts

你可能感兴趣的:(Access)