Friday, December 30, 2011

ASP ADODB.recordset Sort Error - '800a0cb3'

problem:
I'm running a union query via ASP on an NT4 server that houses both IIS and my Pervasive database. Because it's a union, I can't use an ORDER BY sort in the query itself, so I was attempting to sort the returned recordset. However, when the script hits the sort property, I get the following:

ADODB.Recordset error '800a0cb3'

Current provider does not support the necessary interfaces for sorting or filtering.


Here's the gist of my code:

Set Conn = Server.CreateObject("ADODB.Connection")
Set RS = Server.CreateObject("ADODB.RecordSet")
Conn.Open dsn, dbuser, dbpass
sql="SELECT blah blah blah ... " & _
"UNION ALL " & _
"SELECT blah blah blah ..."
RS.Open sql, Conn
RS.Sort = "Part_Number ASC"





Solutions
All set. A Pervasive tech support dude told me to set the cursor as client-side.

I stuck this line before the RS.Open, and it worked fine:

RS.CursorLocation = 3

3 is the enumerated value of adUseClient.

No comments: