插入记录到Msaccess数据库

问题描述:

任何人都可以帮助我使用visualbasic将记录插入到msaccess数据库中。记录条目是在表单中创建的。 在此先感谢。插入记录到Msaccess数据库

我没有得到2008年,但这里有一个办法做到这一点使用2005:

' Open connection to db 
    Dim connection As New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\TestDB.mdb;") 

    connection.Open() 

    ' Create a command to execute 
    Dim command = New OleDbCommand("INSERT INTO TestTable VALUES (100, 'MyName');", connection) 

    ' Execute SQL 
    command.ExecuteReader() 

    ' Close the connection 
    connection.Close() 

你必须摆脱的形式值并把它们放到了INSERT SQL语句。

这一切都取决于你想如何连接到数据库。 ODBC,ADO等

我已经使用SQL来操纵数据。如果你需要帮助,那么你可以看看这里: http://www.w3schools.com/sql/default.asp