hello everyone
what i am trying to do is to save infos like texboxs and checkboxs filled previously in a form in a recently created mdb file
i am still new to vb so i would appriciate your help
using vb 2010 express and access 2013
here is what i managed to do so far
what i want to do is save the rest of info in the recently created database
thanks
what i am trying to do is to save infos like texboxs and checkboxs filled previously in a form in a recently created mdb file
i am still new to vb so i would appriciate your help
using vb 2010 express and access 2013
here is what i managed to do so far
Code:
Private Sub btnsave_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnsave.Click
Dim logger As String = TextBox1.Text
Dim databaseName As String = "C:\databases\" & logger & ".mdb"
Dim tableName As String = "MyTable"
Dim cn As New OleDbConnection
Dim cmd As New OleDbCommand
Dim cat As ADOX.Catalog = New ADOX.Catalog()
cat.Create("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & databaseName & ";Jet OLEDB:Engine Type=5")
MessageBox.Show("Database Created Successfully")
cat = Nothing
Dim con As New OleDb.OleDbConnection("PROVIDER=Microsoft.Jet.OLEDB.4.0;Data Source =" & databaseName)
cmd.CommandText = "INSERT into " & databaseName & " values('" & TextBox1.Text & "','" & TextBox2.Text & "')"
cmd.ExecuteNonQuery()
End Sub
thanks