Greetings,
This one is kind of hard to explain, though the concept is somewhat simple.
I have two databases running a .NET2.0 app. One is an Access2007, and the other is an proprietary ODBC DB. What I want to do is update a table in the Access Database with data from the ODBC database. I don't want to display the data, just basically run an update.
If I open the access database and link the ODBC, simply running a query like so would accomplish it:
The problem with doing it this way, is that this is slower than molasses in winter. 13 seconds slow with minimal test data to be exact.
So I figued creating a dataset might be the solution. I have created my DataSet and added the tables, but now I'm stuck. Can someone help turn the dataset into a query?
If I'm on the wrong track and smoking the powerful stuff, please let me know and point me in a better direction.
"If it's stupid but works, it isn't stupid."
-Murphy's Military Laws
This one is kind of hard to explain, though the concept is somewhat simple.
I have two databases running a .NET2.0 app. One is an Access2007, and the other is an proprietary ODBC DB. What I want to do is update a table in the Access Database with data from the ODBC database. I don't want to display the data, just basically run an update.
If I open the access database and link the ODBC, simply running a query like so would accomplish it:
Code:
UPDATE tblTable1 INNER JOIN ODBCTable2 ON tblTable1.Field1 = ODBCTable2.record_id SET field = field ...;
So I figued creating a dataset might be the solution. I have created my DataSet and added the tables, but now I'm stuck. Can someone help turn the dataset into a query?
Code:
Dim strSQL1, strSQL2 As String
Dim odbcconn as new OdbcConnection(ConfigurationManager.ConnectionStrings("odbcdb").ConnectionString)
Dim oleconn as new OleDbConnection(ConfigurationManager.ConnectionStrings("accdb").ConnectionString)
Dim ds As New DataSet
strSQL1 = "SELECT de_number,de_status,de_owing FROM debtor;"
strSQL2 = "SELECT ptp_rowid,fileno FROM tblPTP;"
Dim odbcDA as OdbcDataAdapter = New OdbcDataAdapter(strSQL1,oleconn)
odbcDA.Fill(ds,"odbcfiles")
Dim oleDA as OleDbDataAdapter = New OleDbDataAdapter(strSQL2,oleconn)
oleDA.Fill(ds,"olefiles")
ds.Relations.Add("olefiles_to_odbcfiles", _
ds.Tables("odbcfiles").Columns("de_number"), _
ds.Tables("olefiles").Columns("fileno"))
odbcconn.Close
oleconn.Close
"If it's stupid but works, it isn't stupid."
-Murphy's Military Laws