local lnHandle, lcSQL, lnRetu lnHandle = sqlconnect() && Pick your connection from the dialog lcSQL = "select * from accesstable blah blah blah" lnRetu = sqlexec(lnHandle,lcSQL,xCursor) if allt(alias()) == "XCURSOR" AND lnRetu = 1 copy structure to mytable.dbf *!* Make sure the field names are not more than 10 characters use mytable.dbf select xcursor scan scatter to memvar memo insert into mytable from memvar select xcursor endscan else return lnRetu endifBasically, dat it.