Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Sort a table inside a MDB database?
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
COM/DCOM et OLE Automation
Versions des environnements
Visual FoxPro:
VFP 6 SP5
OS:
Windows XP SP2
Database:
Visual FoxPro
Divers
Thread ID:
01053143
Message ID:
01053186
Vues:
12
>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
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform