Hello,
I am having the same trouble to write something in a Access
file.
I am getting this error
An unhandled exception of type System.Data.OleDb.OleDbException occurred in system.data.dll
I created a connection exactly the same as stated above.
My access file contains 2 tables
1. Companyinformation
2. Configuration
within the Table Companyinformation Table I have 5 Fields
( company1,company2,company3,company4,company5)
I want to add "Hello" into the company1 field.
And this is my procedure
Public Sub write_info()
Dim command As New OleDbCommand
With command
.CommandText = "Insert into TableNAME (company1) values (" & txtcity.Text & ")"
.CommandText = "Insert into Companyinformation (company1) values (Hello)"
.Connection = connection1
End With
connection1.Open()
command.ExecuteNonQuery()
connection1.Close()
End Sub
What am I missing?
Thanks so much