![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
'Visual Studio 2008, working with an Access 97 table, and an SQL Server 2008 database. I have full rights to both... 'This program runs in x86 mode, due to the lack of a 64-bit JET OLEDB.4.0 driver Dim dsAccess As DataSet = New DataSet Dim dsSQL As DataSet = New DataSet Dim tblAccess As DataTable Dim tblSQL As DataTable ' Opening Source File Dim strAccess As String = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=c:\download\tt.tdf" Dim connAccess As New OleDbConnection(strAccess) Dim daAccess As OleDbDataAdapter = New OleDbDataAdapter("select * from TRoom", connAccess) 'Opening Target File Dim connSQL As SqlConnection = New SqlConnection("Server=MYSERVER;Database=ResourceBo oking;Trusted_Connection=True") Dim daSQL As SqlDataAdapter = New SqlDataAdapter("select * From TRoom", conn) connAccess.Open() connSQL.Open() daAccess.Fill(dsAccess, "TRoom") daSQL.Fill(dsSQL, "TRoom") tblSQL = dsSQL.Tables("TRoom") tblAccess = dsAccess.Tables("TRoom") 'Copying all rows from source to target For Each row As DataRow In tblAccess.Rows tblSQL.ImportRow(row) Next row 'Saving the changes tblSQL.AcceptChanges() da.Update(tblSQL) conn.Close() MsgBox("Done!") I really want this to work. Why doesn't ImportRow actually Import the Row?? I open the table in SQL Server 2K8 after the code has run - no errors - but no data! Mark |
![]() |
| Thread Tools | |
| Display Modes | |
| |