Hi, I’m trying to write a program that stores the values in an array into a database table. The name of the database is Company.mdb and the table that I want to store values is called Employee.
Below is the procedure that is supposed to perform the task. The problem is it doesn’t store the array(strEmployeeRecord) values into the table. Nothing happens. Can someone please help me with this problem? I’m using Visual Studio 2005. Thanks in advance.
Private Sub StoreInTable()
Dim strSQL As String = "INSERT INTO Employee FROM ARRAY strEmployeeRecord "
'strPath provides the database type and path of the Company database
Dim strPath As String = "Provider=Microsoft.Jet.OLEDB.4.0;" & _ "Data Source = D:Company.mdb"
Dim odaRoute As New OleDb.OleDbDataAdapter(strSQL, strPath)
odaRoute.Dispose()
End Sub
Software/Hardware used:
MA Visual Studio 2005
ASKED:
April 23, 2010 9:50 AM
UPDATED:
April 26, 2010 2:52 PM
Chippy, tables don’t need to be ‘opened’. You open connections to the database, not tables.