Im am trying to get a record count for a SQL table from VB6
i have tried the following but i dont know where the ouput(if there is going to be any) will be.
Dim intCount As String
Dim adoBEN As New ADODB.Command
Dim rsBEN As New ADODB.Recordset
adoBEN.ActiveConnection = "dsn=depfund"
adoBEN.CommandText = "select count (*) from Beneficiary where service_number = '" & intsnum & " '"
adoBEN.CommandType = adCmdText
Set rsBEN = adoBEN.Execute()
intCount = rsBEN
I also created a ado control and tried the following to no avail. It seems to work for a access db.
adoCount.RecordSource = "select count (*) from Beneficiary where service_number = '" & intsnum & "'"
txtCount = adoCount
i have run the query in analyzer and it works fine....i have also made sure the intsnum variable contains a value when run.
Please let me know what im doing wrong.