0
VB.NET數據在訪問數據庫時會臨時保存,當我終止應用程序時,數據會自動從數據庫中刪除。這裏是代碼: -數據臨時保存到訪問數據庫。當我終止應用程序時,數據將自動從數據庫中刪除
con1.Open()
Dim da As New OleDbDataAdapter
Dim cmd As New OleDb.OleDbCommand
cmd.Connection = con1
cmd.CommandText = "INSERT INTO Journal(UsedAccount,Effect,Purpose,EffectedAccount,Amount,Datex) VALUES('" & Me.ComboBox1.SelectedItem & "','" & effect & "','" & Me.TextBox1.Text & "','" & Me.ComboBox3.SelectedItem & "','" & Me.TextBox2.Text & "','" & Me.DateTimePicker1.Value & "')"
cmd.ExecuteNonQuery()
con1.Close()
我的代碼做錯了什麼?我怎樣才能防止數據被自動刪除?
仔細檢查您的訪問路徑。 – spajce