Case 1: i can't insert data to my database
Dim conn As New OleDbConnection("Provider=Microsoft.ACE.OLEDB.12.0;Data Source=|DataDirectory|\ProjectVB.accdb") Case 2: i can insert data to my database
Dim conn As New OleDbConnection("Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\Users\Admin\Documents\ProjectVB.accdb") database was saved in my project already
conn.Open() cmd.Connection = conn cmd.Parameters.AddWithValue("@ac_ID", txtID.Text) cmd.Parameters.AddWithValue("@ac_pass", txtPassword.Text) cmd.Parameters.AddWithValue("@nation_ID", txtNoID.Text) cmd.Parameters.AddWithValue("@fName", txtFirstName.Text) cmd.Parameters.AddWithValue("@lName", txtLastName.Text) cmd.Parameters.AddWithValue("@tel", txtTel.Text) cmd.Parameters.AddWithValue("@province", cbNation.SelectedItem) cmd.Parameters.AddWithValue("@regOn", dtRegOn.Text) cmd.Parameters.AddWithValue("@status", txtStatus.Text) cmd.Parameters.AddWithValue("@gender", cbGender.SelectedItem) cmd.Parameters.AddWithValue("@location", txtLocation.Text) cmd.Parameters.AddWithValue("@img", imgBuffer) cmd.Parameters.AddWithValue("@rank", cbRank.SelectedItem) cmd.CommandText = "INSERT INTO db_KJ_Profile VALUES(@ac_ID,@ac_pass,@nation_ID,@fName,@lName,@tel,@province,@regOn,@status,@gender,@location,@img,@rank)" cmd.ExecuteNonQuery()