C
Carlos Garcia via AccessMonster.com
Hello,
I'm looking for some help, I'm using the code below and It seems that VBS
cannot execute RIGH Join on a SQL statement. Thank you in advance for any
help. Thanks.
Sub TableUpdate(MDBFile, TableSource, TableDestination, TableField)
Dim oJet ' DAO.DBEngine
Dim oDB ' DAO.Database
Dim strSQL ' String
Dim strSQLNew ' String
Set oJet = CreateObject("DAO.DBEngine.36")
Set oDB = oJet.OpenDatabase(MDBFile)
strSQL = "INSERT INTO " & TableDestination & "." & TableField _
& " SELECT " & TableSource & "." & TableField _
& " FROM " & TableDestination & " RIGHT JOIN" & TableSource & " ON " &
TableDestination & "." & TableField & " = " & TableSource & "." &
TableField _
& " WHERE " & TableSource & "." & TableField & " Is Not Null;"
oDB.Execute strSQL
End Sub
I'm looking for some help, I'm using the code below and It seems that VBS
cannot execute RIGH Join on a SQL statement. Thank you in advance for any
help. Thanks.
Sub TableUpdate(MDBFile, TableSource, TableDestination, TableField)
Dim oJet ' DAO.DBEngine
Dim oDB ' DAO.Database
Dim strSQL ' String
Dim strSQLNew ' String
Set oJet = CreateObject("DAO.DBEngine.36")
Set oDB = oJet.OpenDatabase(MDBFile)
strSQL = "INSERT INTO " & TableDestination & "." & TableField _
& " SELECT " & TableSource & "." & TableField _
& " FROM " & TableDestination & " RIGHT JOIN" & TableSource & " ON " &
TableDestination & "." & TableField & " = " & TableSource & "." &
TableField _
& " WHERE " & TableSource & "." & TableField & " Is Not Null;"
oDB.Execute strSQL
End Sub