troubleshooting Question

Counting total number of database records using SQL and ASP

Avatar of BenthamLtd
BenthamLtd asked on
3 Comments1 Solution492 ViewsLast Modified:
Dear EE community,

Very simple and quite embarrassing problem but it's sometimes easier to ask on here. I can't get my asp page to output a total of all records on my database, "callnotes".

I've attached the code below. Anything blatantly obvious that I'm doing wrong?

Thanks as always.

Set OBJdbConn = Server.CreateObject("ADODB.Connection")
OBJdbConn.Open = "Driver={MySQL ODBC 3.51 Driver};Server=centos5;Database=ijtd_export; User=root;Password=****;Option=3;"
Set OBJdbConn2 = Server.CreateObject("ADODB.Connection")
OBJdbConn2.Open = "Driver={MySQL ODBC 3.51 Driver};Server=centos5;Database=outcall; User=root;Password=****;Option=3;"
Set OBJdbConn3 = Server.CreateObject("ADODB.Connection")
OBJdbConn3.Open = "Driver={MySQL ODBC 3.51 Driver};Server=centos5;Database=ijtd_export; User=root;Password=****;Option=3;"
Dim rsQuery
SQLQuery = "SELECT count(NoteID) FROM callnotes"
Set rsQuery = OBJdbConn2.Execute(SQLQuery)
Dim GlobalTotal
GlobalTotal = rsQuery("NoteID")
Total records: <%=GlobalTotal%>
Set OBJdbConn2 = Nothing
Join the community to see this answer!
Join our exclusive community to see this answer & millions of others.
Unlock 1 Answer and 3 Comments.
Join the Community
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 3 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros