lnHandle = sqlconnect() && Use the proper arguments here for an ODBC connection. lcSql = "select * from tableref order by tablerefno" lnReturn = sqlexec(lnHandle,lcSql,'TMPCUR') if allt(alias()) != "TMPCUR" or lnReturn < 1 messagebox("No data returned from table reference.",0+48+0,"dsio.prg") return -1 else select tmpcur cursorsetprop("Tables","dbo.Tableref") cursorsetprop("UpdateNameList","tablerefno dbo.tableref.tablerefno,sourcerefno dbo.tableref.sourcerefno,"+; "tablename dbo.tableref.tablename,tablewidth dbo.tableref.tablewidth,"+; "lastupdate dbo.tableref.lastupdate,datename dbo.tableref.datename,"+; "dest dbo.tableref.dest,subquery dbo.tableref.subquery,note dbo.tableref.note") cursorsetprop("KeyFieldList",'tablerefno') cursorsetprop("UpdatableFieldList","tablerefno,sourcerefno,tablename,tablewidth,"+; "lastupdate,datename,dest,subquery,note") cursorsetprop("SendUpdates",.T.) cursorsetprop("Buffering", 3) endif && Do whatever you want to the cursor here Tableupdate(.T.,.T.)lcSql can have a where clause with as many filter conditions as you want and can join as many tables as you want using the proper SQL syntax for the backend you are using. This particular piece is used with sybase.