Hi good day.!
Im so confused why my code to get the total records in a certain table in sql server returns false. Im already connected to sql server and set-up a table named "loanlist".This table contains 10 records. But when i want to get the recordcount, it will returned to -1. Please help. My code below.
Sub loadloanlist() dim totalrowintbl as integer objCommand.ActiveConnection = strConnection objCommand.CommandText = "Select * from loanlist" objCommand.CommandTimeout = 600 objCommand.CommandType = adCmdText Set objRS = objCommand.Execute totalrowintbl= objRS.RecordCount msgbox totalrowintbl objRS.Close Set objCommand = Nothing Set objRS = Nothing end sub
Pls help guys!.Thank you for your time.