Hi,
Ok i'm trying to add a new record to my database, below is the code i have but it doesnt seem to be working. Does anyone know why? I dont even get the message box saying new record added. Any help would be great.
Thanks in advanceCode:''BEGIN DATABASE CONNECTION con.ConnectionString = "PROVIDER=Microsoft.Jet.OLEDB.4.0;Data Source = W:\Textvertising\database.mdb" da = New OleDb.OleDbDataAdapter(sql, con) logto = TextBox1.Text logfrom = TextBox2.Text logmessage = TextBox3.Text Dim cb As New OleDb.OleDbCommandBuilder(da) Dim dsNewRow As DataRow dsNewRow = ds.Tables("SMS").NewRow() dsNewRow.Item("ID") = logid dsNewRow.Item("To") = logto dsNewRow.Item("From") = logfrom dsNewRow.Item("Message") = logmessage ds.Tables("SMS").Rows.Add(dsNewRow) da.Update(ds, "SMS") MsgBox("New Record added to the Database") ''END DATABASE CONNECTION![]()


Reply With Quote
icon on the left of the post.
