>Hi Everybody,
>
>I am connecting to a MDB (Access database) like this:
>
>My_conn = CreateObject("ADODB.Connection")
>My_conn.Open ("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=c:\mypath\mydatabase.mdb")
>
>I would like to sort a table in this database by a field. How can I do that?
>Is there any way that I can sort a table inside a MS Access database using VFP?
>
>Thank you,
>Ali
If all you need is to view this table in a sorted order, I've always been able to accomplish this by opening it using a connections string, and specifying the SELECT statement in the Open.
oADO = CREATEOBJECT("adodb.connection")
oADO.ConnectionString = "your string here"
oADO.Open()
oMain = CREATEOBJECT("adodb.recordset")
oMain.Open([SELECT Fields FROM table ORDER BY however],oADO)