Sort order cannot be applied (80040e60)

Sort order cannot be applied (80040e60)

Post by Sanjeev K » Sat, 01 Mar 2003 21:21:24



Hi,

I am working on a project which does not use a Database as backend. Instead
it uses a Disconnected Recordset to store and Manipulate Data.

With rs
    Set .ActiveConnection = Nothing
    .CursorLocation = adUseClient
    .LockType = adLockBatchOptimistic

    With .Fields
        .Append "MDate", adDBDate
        .Append "From", adBSTR
        .Append "To", adBSTR
        .Append "TotalCount", adInteger
    End With
End With

After Necessary Processing the data is saved in XML Format.

rs.save App.Path & "\Data.xml"

But before saving i need to generate a report. I am trying to do this by

Set rs2 = New ADODB.Recordset
rs2.CursorLocation = adUseClient

rs.Filter = "mdate >= '" & dtpFrom.Value & "' and mdate <='" & dtpTo.Value &
"'"
Set rs2 = rs
rs2.Sort = "MDate,from"
rs.Filter = adFilterNone

But each time i try to generate the report it produces an error:
    -2147217824 (80040e60)
    Sort order cannot be applied

Can anyone Please help me out.

Regards,
Sanjeev K. B

 
 
 

Sort order cannot be applied (80040e60)

Post by Val Mazu » Sat, 01 Mar 2003 21:50:49


Hi,

Reason is simple. You canNOT sort on any BLOB type data. Basically same
rules apply for SQL server and probably other databases as well. There is no
way to sort BSTR, TEXT or other BLOB-type column. What you could do here is
to declare your column as a VarChar and then you could use Sort

--
Val Mazur
Microsoft MVP



> Hi,

> I am working on a project which does not use a Database as backend.
Instead
> it uses a Disconnected Recordset to store and Manipulate Data.

> With rs
>     Set .ActiveConnection = Nothing
>     .CursorLocation = adUseClient
>     .LockType = adLockBatchOptimistic

>     With .Fields
>         .Append "MDate", adDBDate
>         .Append "From", adBSTR
>         .Append "To", adBSTR
>         .Append "TotalCount", adInteger
>     End With
> End With

> After Necessary Processing the data is saved in XML Format.

> rs.save App.Path & "\Data.xml"

> But before saving i need to generate a report. I am trying to do this by

> Set rs2 = New ADODB.Recordset
> rs2.CursorLocation = adUseClient

> rs.Filter = "mdate >= '" & dtpFrom.Value & "' and mdate <='" & dtpTo.Value
&
> "'"
> Set rs2 = rs
> rs2.Sort = "MDate,from"
> rs.Filter = adFilterNone

> But each time i try to generate the report it produces an error:
>     -2147217824 (80040e60)
>     Sort order cannot be applied

> Can anyone Please help me out.

> Regards,
> Sanjeev K. B



 
 
 

1. Sort order cannot be applied (80040e60)

Hi,

I am working on a project which does not use a Database as backend. Instead
it uses a Disconnected Recordset to store and Manipulate Data.

With rs
    Set .ActiveConnection = Nothing
    .CursorLocation = adUseClient
    .LockType = adLockBatchOptimistic

    With .Fields
        .Append "MDate", adDBDate
        .Append "From", adBSTR
        .Append "To", adBSTR
        .Append "TotalCount", adInteger
    End With
End With

After Necessary Processing the data is saved in XML Format.

rs.save App.Path & "\Data.xml"

But before saving i need to generate a report. I am trying to do this by

Set rs2 = New ADODB.Recordset
rs2.CursorLocation = adUseClient

rs.Filter = "mdate >= '" & dtpFrom.Value & "' and mdate <='" & dtpTo.Value &
"'"
Set rs2 = rs
rs2.Sort = "MDate,from"
rs.Filter = adFilterNone

But each time i try to generate the report it produces an error:
    -2147217824 (80040e60)
    Sort order cannot be applied

Can anyone Please help me out.

Regards,
Sanjeev K. B

2. Multi-Table Form - Detail Table Edit Problem

3. Error: Sort Order Cannot Be Applied

4. Connection to myODBC thru VB

5. Sort order cannot be applied - SOLUTION

6. Informix only jobs

7. Converting a database from dictionary case insensitive sort order to binary sort order

8. HELP! How can I do a two-fer?

9. Oracle sort order on HP-UX versur Windows sort order