ADO DOT NET
Well-known member
- Joined
- Dec 20, 2006
- Messages
- 156
Hi all,
Does anyone know if this is wrong somewhere?
My form closes without any exception/warning!!!
Does anyone know if this is wrong somewhere?
My form closes without any exception/warning!!!
Code:
Try
Dim StringConnection As String = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + My.Application.Info.DirectoryPath + "\AccessDB.mdb;Jet OLEDB:Database Password = mypass"
Dim MyConnection As New OleDbConnection(StringConnection)
MyConnection.Open()
Dim CreateGroup As New OleDb.OleDbCommand("INSERT INTO Groups (GroupName) VALUES (" + GroupName.Text + ")", MyConnection)
CreateGroup.ExecuteNonQuery()
MyConnection.Close()
Catch Ex As Exception
MsgBox(Ex.Message.ToString)
End Try