Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Sort a table inside a MDB database?
Message
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Environment versions
Visual FoxPro:
VFP 6 SP5
OS:
Windows XP SP2
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01053143
Message ID:
01053186
Views:
11
>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)
Fred
Microsoft Visual FoxPro MVP

foxcentral.net
Previous
Reply
Map
View

Click here to load this message in the networking platform