Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

failure to display results

Status
Not open for further replies.

Sarky78

Programmer
Oct 19, 2000
878
GB
Hi

Had a database that was in Access and has now been imported in SQL Server 7, when i run a query that was working fine against the Access backend it fails to display any results.

The code is the same nothing has changed. the query is actually returning information as i have dumped some out onto the page.

the code for the query is:

strQry ="Select * from tblPress WHERE Display=1 ORDER BY AddDate DESC"
objRS.Open strQry, objConn,3,3

I have got an if statement which is being invoked that checks to see if the recordcount is greater than 1. Can the recordcount function be used with sql server 7 ???

hope this makes sense !

any ideas ?
 
recordcount can be used with SQL Server 7, it can be used by any DBMS. You just need to make sure that your cursor supports backwards and forwards movement, or else you'll get -1 returned. You are using the correct cursor type, (3 or adOpenStatic), so I don't think that would be the problem. How exactly are you erroring?

leo leo
 
recordcount is supported in the recordset object.

if you want to know if your select retrieved something you can use: rs.bof and rs.eof.
br
Gerard
 
I have had a look at the result returned by the recordcount and it is a -1, which i find quite weird, as it was returning the correct value for the returned recordset now it is not ???? weird

what i ahve done is to remove the second 3 that i was using, and now it is working, and actually displaying the information. happy now. I dn't really understand all this cursor type lark yet, quite new to asp. Can you guys point me the direction of a website that could explain it, have seen the faq on this forum and that made a bit of sence but just want to clarift a few things

thanks for your help !
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top