danasegarane
Active member
- Joined
- Jun 14, 2006
- Messages
- 41
- Programming Experience
- Beginner
Dear All,
I am using this code to insert table to MSAccess from SQL.But it is not producing any data in the Access table.Can some body help
I am using this code to insert table to MSAccess from SQL.But it is not producing any data in the Access table.Can some body help
VB.NET:
Private Sub FillAccesstables(ByVal sTablename As String)
Dim sqltemptable As DataTable 'sql temp table
Dim datemptable As DataTable 'access temp table
Dim sqlcmdtext As SqlCommand
Dim dacmdtext As OleDbCommand
Dim sqltemp As String = String.Empty
Dim oletemp As String = String.Empty
sqltemp = "Select * from " & sTablename
sqlcmdtext = New SqlCommand(sqltemp, con)
dacmdtext = New OleDbCommand(sqltemp, AccessOledbCon)
SQLAdapter = New SqlDataAdapter(sqlcmdtext)
SQLAdapter.AcceptChangesDuringFill = False
sqltemptable = New DataTable
datemptable = New DataTable
SQLAdapter.Fill(sqltemptable)
OLAdapter = New OleDbDataAdapter(dacmdtext)
OLAdapter.Fill(datemptable)
OLAdapter.AcceptChangesDuringFill = True
SQLAdapter.Update(datemptable)
End Sub