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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Display Record Count

Status
Not open for further replies.

Llazwas

IS-IT--Management
Feb 16, 2007
58
US
Please forgive me as I'm very new to this.

I'm connecting to a ProvideX database trying to get a record count from one table. It looks like my connection is working okay and it appears that the code is actually counting the records but I'd like to display the count to verify. Is there a way to do that?

strConnectionString = "DSN=SOTAMAS90;UID=swk|ABC;PWD="
Set objCN = CreateObject("ADODB.Connection")
objCN.Open strConnectionString

Set objRS = CreateObject("ADODB.Recordset")
strSQLQuery = "SELECT count(*) from SY_UDT_HOLIDAY_CODE "
Set objRS = objCN.Execute(strSQLQuery)
 
if not objRS.EOF then
objRS.MoveFirst
rec_count = objrs.Fields.Item(1)
end of

msgbox rec_count
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top