我想插入一個新的記錄到msaccess2003 mdb文件我的版本是VB.net 2005,它不顯示任何錯誤,也當我打開我的訪問數據庫文件時,沒有記錄插入的,也是我如何格式化日期字段它給我的錯誤,我怎麼能txtdate.text轉換爲最新與MS兼容接取使用數據集在msaccess中插入新記錄
這裏是代碼
Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
Dim ds As New DataSet
Dim db As New ClassDB
ds = db.FetchData("ricemill.mdb", "sales")
Dim anyRow As DataRow = ds.Tables(0).NewRow
Dim mydate As DateTime
Dim cmydate As String
cmydate = txtdate.Text
mydate = DateTime.Parse(mydate)
anyRow("description") = txtdesc.Text
anyRow("date") = DateTime.Parse(txtdate.Text)
anyRow("amount") = txtamount.Text
ds.Tables(0).Rows.Add(anyRow)
ds.Tables(0).AcceptChanges()
ds.AcceptChanges()
MsgBox("Record Added ! ")
End Sub