hi im really struggling to get a one button import routine running i import a xls into a data grid this bit works great, i then want it to insert into a database table "mdb" on the fly. i found some code online but this errors. what im looking for a way to drop all data from the grid into a table
thanks for any help given
An unhandled exception of type 'System.ArgumentException' occurred in System.Data.dllAdditional information: Keyword not supported: 'provider'.
Dim da As SqlDataAdapter
Dim cb As SqlCommandBuilder
Dim ds1 As New DataSet
Dim ds2 As New DataSet
Dim dbPath1 As String
dbPath1 = VB6.GetPath & "\" & "core.mdb"
Dim conn As New SqlConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source ='" & dbPath1 & " ';")
'This line fails
' conn = New SqlConnection("Data Source=Provider=Microsoft.Jet.OLEDB.4.0; Data source ='" & dbPath1 & "'; Jet OLEDB:database password=123")
Dim sel As String = "SELECT * FROM Table1"
da = New SqlDataAdapter(sel, conn)
cb = New SqlCommandBuilder(da)
da.MissingSchemaAction = MissingSchemaAction.AddWithKey
da.Fill(ds2, "Table1")
Me.DataGridView1.DataSource = ds2
Me.DataGridView1.DataMember = "Table1":miserable:
thanks for any help given
An unhandled exception of type 'System.ArgumentException' occurred in System.Data.dllAdditional information: Keyword not supported: 'provider'.
Dim da As SqlDataAdapter
Dim cb As SqlCommandBuilder
Dim ds1 As New DataSet
Dim ds2 As New DataSet
Dim dbPath1 As String
dbPath1 = VB6.GetPath & "\" & "core.mdb"
Dim conn As New SqlConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source ='" & dbPath1 & " ';")
'This line fails
' conn = New SqlConnection("Data Source=Provider=Microsoft.Jet.OLEDB.4.0; Data source ='" & dbPath1 & "'; Jet OLEDB:database password=123")
Dim sel As String = "SELECT * FROM Table1"
da = New SqlDataAdapter(sel, conn)
cb = New SqlCommandBuilder(da)
da.MissingSchemaAction = MissingSchemaAction.AddWithKey
da.Fill(ds2, "Table1")
Me.DataGridView1.DataSource = ds2
Me.DataGridView1.DataMember = "Table1":miserable: