插入记录到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