|
-
Feb 28th, 2003, 03:07 PM
#1
Thread Starter
Fanatic Member
sort recordset property
when i tried to use that property with Jet.OLEDB.4.0 Provider it said that the provider doesn't support that.
which provider supports it? and can i use that provider working with access DB?
thnks
-
Mar 2nd, 2003, 07:24 AM
#2
Sorting Records
Like the Filter property, the DAO and ADO Sort properties differ in that the DAO Sort method applies to subsequently opened Recordset objects, and for ADO it applies only to the current Recordset object.
The Microsoft Jet 4.0 OLE DB Provider doesn't support the IViewFilter or IViewSort OLE DB interfaces that ADO uses to filter and sort Recordset objects. For the Filter property, ADO will automatically call the client cur....
I think this implies that you should use ADO if you wish to use the sort method.
-
Mar 6th, 2003, 05:03 PM
#3
Thread Starter
Fanatic Member
mendhak i m using ADO. but a code like bellow is not working saying that is a provider problem
VB Code:
cnn.connectionstring="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=access.mdb"
cnn.open
rs.CursorLocation=adUseClientset
set rs=cnn.execute("Select * from Table1")
rs.sort="field1"
-
Mar 6th, 2003, 05:44 PM
#4
By default the statement
Set Recordset = Connection.Execute
returns a Forward-Only cursor, which cannot be sorted.
Use the Recordset.Open method instead.
rs.Open "Select * from Table1", cnn, adOpenStatic, adLockReadOnly
You will then be able to sort the records.
FYI: The Connection.Execute statement creates a new recordset. The rs.CursorLocation = adUseClient statement before the Execute statement is useless.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|