FIX: ADO Recordset Sort Property Errors (216875)
The information in this article applies to:
- ActiveX Data Objects (ADO) 1.5
- ActiveX Data Objects (ADO) 2.0
- ActiveX Data Objects (ADO) 2.01
This article was previously published under Q216875 SYMPTOMS
The ADO documentation for the Sort property of the Recordset states the following:
Sets or returns a String of comma-separated field names to sort on where each name is a Field in the Recordset and is optionally followed by a blank and the keyword ASCENDING or DESCENDING.
However, when you set the Sort property to au_id DESCENDING (where au_id is a field in your database), the following error occurs on the Recordset::Open: -2146825287
The application is using arguments that are of the wrong type, are out of acceptable range, or are in conflict with one another.
The current ADO 2.1 and later documentation corrects the syntax. The keywords are DESC instead of DESCENDING and ASC instead of ASCENDING. If you set the Sort property to au_id DESC or au_id ASC, it will work with the versions of ADO mentioned at the beginning of this article.
STATUS
The documentation after ADO 2.1 documentation corrects the syntax. The keywords are DESC instead of DESCENDING and ASC instead of ASCENDING. If you set the Sort property to au_id DESC or au_id ASC, it will work with the versions of ADO mentioned at the beginning of this article.
Modification Type: | Major | Last Reviewed: | 8/23/2001 |
---|
Keywords: | kbADO210sp2fix kbbug kbDatabase kbdocerr kbDSupport kbMDACNoSweep KB216875 |
---|
|