lcKey = key() select &lcKey, recno() as Physical from my table order by 1Threat #429434
#define TESTDATALOC C:\TEMP\testdata.DBC strCn = [Provider=MSDataShape.1;Persist Security Info=False;]+; [Data Source="Data Provider = MSDASQL;]+; [DSN=Visual FoxPro Database;UID=;SourceDB=TESTDATALOC;]+; [SourceType=DBC;Exclusive=No;BackgroundFetch=Yes;Collate=Machine;Null=Yes;]+; [Deleted=Yes;";Data Provider=MSDASQL ] strShp = [SHAPE { select customer.cust_id, Company, ]+; [ orders.order_id, order_date, order_net, shipped_on, ]+; [ line_no, prod_name ] +; [ from customer ]+; [ left outer join orders ]+ ; [ on customer.cust_id = orders.cust_id ] +; [ inner join orditems ]+ ; [ on orditems.order_id = orders.order_id ] +; [ inner join products ]+ ; [ on orditems.product_id = products.product_id } ] with this .CommandType = 1 .ConnectionString = strCn .RecordSource = strShp endwith with ThisForm.Flex .Datasource = This.object for ix = 1 to .Cols - 1 .MergeCol(ix) = .t. endfor .MergeCells = 3 endwith thisform.DoSort(ThisForm.Flex)Cetin