Xakiz Posted March 30, 2011 Posted March 30, 2011 Hello, I have a problem with my script: dim connection dim recordSet dim connectionString dim results dim sqlQuery set recordSet = Server.CreateObject("ADODB.Recordset") recordSet.MaxRecords = 100 set connection = Server.CreateObject("ADODB.Connection") sqlQuery = "SELECT * FROM contacts_tbl" connectionString = "Provider=sqloledb; Server=JOHNY-PC; Database=organiser; Trusted_Connection=Yes;" connection.Open connectionString recordSet.Open sqlQuery, connection Response.Write("records: " & recordset.Fields.Count) So - in the last line I'm checking quantity of returned rows. Whatever is my sqlQuery string, recordSet always reads three rows. Why it is like that? How can I fix it?
Steve21 Posted March 30, 2011 Posted March 30, 2011 You trying to count the records, or fields? Shouldn't recordset.Fields.Count be recordset.RecordCount if it's returned rows? Steve
CESIL Posted March 30, 2011 Posted March 30, 2011 Response.Write("records: " & recordset.Fields.Count) You seem to be returning a count of the number of fields (columns) in your recordset rather than a count of the records (rows).
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now