I always got an empty recordset with linked tables. I'm using DataDirect 4.2 Sybase Wire Protocol driver to linked table via MS Access 2003. I needed to update the data. It worked fine before when I linked these tables from another database locally but doesn't work when i moved all the table to Sybase. I have a form to navigate thru those records (queries with join) and a subform that display the the table that I wanted to update. Everytime I updated the current record in the subform, an event afterupdate will be execute the following codes to update the data. Please let me know what 's wrong with the code. Each tables do have a primary key.
Dim t_master_sql_1 As String
Dim sql As String
Dim sql2 As String
Dim r_sla As DAO.Recordset
Dim db As Database
Set db = CurrentDb
sql = " SELECT table1.ID, table1.field2, table1.field3, table1.field4, table2.field2, table2.field3, table3.field3 FROM table1, table2, table3
WHERE table1.ID = " & currentID
AND table1.field2 = table2.field2
AND table1.fiedl3 = table3.field3
Set r_sla = CurrentDb.OpenRecordset(t_master_sql_1)
If r_sla.RecordCount = 0 Then
Do calculation here to get result.....
t_master_sql_2 = "UPDATE table1 SET field4 = '" & result &"'"