I have codes below that can update and inner join data with another table within a database, also it uses only one connection string because they are both in the same database.
All I want is the same function that can update data of a table from another table of another database with different database connection string. Below are the two databases connection string:Code:Dim connstring1 As String connstring1 = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=AMP.accdb" Dim conn1 As OleDbConnection = New OleDbConnection(connstring1) Dim updatescardrate As String = "UPDATE scard INNER JOIN Employee_Records ON scard.controlnumber = Employee_Records.controlnumber SET scard.rate = Employee_Records.rate" Dim cmdupdatescardrate As New OleDbCommand(updatescardrate, conn1) conn1.Open() cmdupdatescardrate.ExecuteNonQuery() conn1.Close()
Connection1
Connection2Code:Dim connstring1 As String connstring1 = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=AMP.accdb"
Sample expected result illustration:Code:Dim connstring2 As String connstring2 = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=IMS.accdb"
UPDATE Table scard.column1(this is from connection1, database: AMP.accdb)
and JOIN data from Table criteria.column3(this is from connection2, database: IMS.accdb)
Any idea, suggestion or revision regarding with my codes is highly appreciated. Thank you


Reply With Quote
