Hi - I am sure this is a very simple question, if you know what the terminology is - but I don't and it has me stuck so any help would be very much appreciated.
I am querying a fairly simple table and just need to know how many records are returned from the query. If I use the recordcount function of the recordset it constantly states it is -1, but in debug mode I can see that a number of records have been returned.
The code for my query is shown below,
Dim conDB As New ADODB.Connection
Dim cmdDB As New ADODB.Command
Dim rsDB As New ADODB.Recordset
conDB.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source = c:\revolution\Optom.mdb"
cmdDB.ActiveConnection = conDB
cmdDB.CommandText = "SELECT count(*) FROM Exception_days where business_date between #" & Trim(Str(cmbMonth.SelectedIndex + 1)) & "/01/" & Trim(cmbYear.SelectedItem) & "# and #" & Trim(Str(cmbMonth.SelectedIndex + 1)) & "/" & Trim(Str(iDaysinMonth)) & "/" & Trim(cmbYear.SelectedItem) & "#"
rsDB = cmdDB.Execute