PDA

View Full Version : Cursor engine and E_FAIL


the A chick
08-01-02, 17:42
I am getting the following error on one of my ASP pages:

Error Type:
Microsoft Cursor Engine (0x80004005)
Data provider or other service returned an E_FAIL status.

I have no idea how to fix the problem, especially because the code exists on three other pages that are working fine. It happened once before and I don't remember what I did except move the cursor assignment, which didn't help because it messed up other code. Any suggestions would be greatly appreciated.

rnealejr
08-02-02, 02:03
What is the statement in your code that is causing this error ? Are you using xp_sendmail ?

the A chick
08-02-02, 12:03
Originally posted by rnealejr
What is the statement in your code that is causing this error ? Are you using xp_sendmail ?

This is the code that is causing the problem:

'explicitly create a recordset object
set rstPanning = Server.CreateObject("ADODB.Recordset")
'set cursor location property
rstPanning.CursorLocation = adUseClient
'set cache size equal to # records/page
rstPanning.CacheSize = NUM_PER_PAGE
'open recordset
rstPanning.Open strPanningSQL,AbTechconn

'rstPanning.MoveFirst
rstPanning.PageSize = NUM_PER_PAGE

'get max number of pages
Dim TotalPages
TotalPages = rstPanning.PageCount
'set absolute pages
rstPanning.AbsolutePage = CurPage

After I open the recordset, every reference to it causes the error (like the CacheSize assignment). It just doesn't make any sense because this code is identical on other pages that are working and I copied the code from an article on pagination. Do you know what this error means?

rnealejr
08-03-02, 17:11
How is NUM_PER_PAGE defined ? Also, how are you referencing the vb constants like adUseClient ? What database are you hitting ? What is your query ?

qztm51
02-27-03, 16:21
Did you ever get a resolution to your post. I am having the same issue and I can't find a work around. Hope you don't mind my asking.

thanks,

skeeterbug
04-12-03, 01:47
Take out this line of code
conn.CursorLocation = adUseClient
I was getting the same error only with my "SELECT * FROM table" statements. I took out the cursorlocation and no more error! Imagine that!

qztm51
04-14-03, 11:02
Thanks for your reply! Works fine now. That one was really frustrating, thanks again.