J, i think it should be? :
???Code:SELECT Count(*) AS MyCount FROM performances WHERE (((performances.Status)=""Available""))"
J, i think it should be? :
???Code:SELECT Count(*) AS MyCount FROM performances WHERE (((performances.Status)=""Available""))"
Also, since you're using the ADO recordset, you can simply do this:
See here: ADO RecordCount PropertyCode:Dim ticketCount ticketCount = availabilityRS.RecordCount
jmurrayhead
If you agree, give me rep.
If you like it here...throw us a few bones to help support us.
The reason I removed the asterisk is for performance reasons. See this Google search for more information: SELECT COUNT performance
jmurrayhead
If you agree, give me rep.
If you like it here...throw us a few bones to help support us.
I have had a bit of a go with what you posted. Unfortunatly the recordset count displays a "-1" value. Im lost now.. If anyone else knows of a solution, i would appreciate
edit: think i found the solution.. im gonna try it now
http://www.slxdeveloper.com/page.asp...e&articleid=33
Having looked at the link.. I am having problems getting the page to work..
my code:
Getting this error:Code:<% Option Explicit <!--#include virtual="adovbs.inc"--> DIM availabilitySQL, availabilityConn, availabilityRS, adUseClient set availabilityConn=Server.CreateObject("ADODB.Connection") availabilityConn.ConnectionString="Provider=Microsoft.Jet.OLEDB.4.0" availabilityConn.open server.mappath("../db/database.mdb") 'query to check all the shows that are available availabilitySQL = "SELECT * FROM shows" Set availabilityRS = Server.CreateObject("ADODB.Recordset") availabilityRS.Open availabilitySQL, availabilityConn With availabilityRS .CursorLocation = adUseClient .Open availabilitySQL, Application.availabilityConn MsgBox .RecordCount & " records" .Close End With Set availabilityRS = Nothing %>
ADODB.Recordset error '800a0e79'
Operation is not allowed when the object is open.
/groupV2.asp, line 17
You are opening it twice:
Code:<% Option Explicit <!--#include virtual="adovbs.inc"--> DIM availabilitySQL, availabilityConn, availabilityRS, adUseClient set availabilityConn=Server.CreateObject("ADODB.Connection") availabilityConn.ConnectionString="Provider=Microsoft.Jet.OLEDB.4.0" availabilityConn.open server.mappath("../db/database.mdb") 'query to check all the shows that are available availabilitySQL = "SELECT * FROM shows" Set availabilityRS = Server.CreateObject("ADODB.Recordset") availabilityRS.Open availabilitySQL, availabilityConn With availabilityRS .CursorLocation = adUseClient .Open availabilitySQL, Application.availabilityConn MsgBox .RecordCount & " records" .Close End With Set availabilityRS = Nothing %>
jmurrayhead
If you agree, give me rep.
If you like it here...throw us a few bones to help support us.
Yes, it has to be open, but you are opening it twice. Change this:
To this:Code:With availabilityRS .CursorLocation = adUseClient .Open availabilitySQL, Application.availabilityConn MsgBox .RecordCount & " records" .Close End With
If still errors after that, post the code you have and highlight the line the error is occurring on.Code:With availabilityRS .CursorLocation = adUseClient MsgBox .RecordCount & " records" .Close End With
jmurrayhead
If you agree, give me rep.
If you like it here...throw us a few bones to help support us.
Sorry J, no luck for me.. here is my code:
Code:<%Option Explicit <!--#include virtual="adovbs.inc"--> DIM availabilitySQL, availabilityConn, availabilityRS, adUseClient set availabilityConn=Server.CreateObject("ADODB.Connection") availabilityConn.ConnectionString="Provider=Microsoft.Jet.OLEDB.4.0" availabilityConn.open server.mappath("../db/database.mdb") 'query to check all the shows that are available availabilitySQL = "SELECT performances.performanceID, shows.showName, performances.status FROM shows INNER JOIN performances ON shows.showID = performances.showID WHERE (((performances.status) = ""Available"")) GROUP BY performances.performanceID, shows.showName, performances.status" Set availabilityRS = Server.CreateObject("ADODB.Recordset") availabilityRS.Open availabilitySQL, availabilityConn With availabilityRS .CursorLocation = adUseClient MsgBox .RecordCount & " records" .Close End With Set availabilityRS = Nothing %>
Bookmarks