I'm sure this must be do-able but i just cannot get it to work.
I'm using Jet to connect to an Access 2002 db. All the sql requests
I've tried so far have worked so far but I've now hit a brick wall.
I have a table with a column DSCD which contains identifiers in the
format 'A00000' where A is either upper case or lower case letter
followed by a 5 digit number.
The problem I'm having is that i want to count the number of records
which start with a capital letter. I've tried so many different ways
but always get back a count including the lowercase records.
Somebody please put me out of my misery!!!
Private Sub Form_Load()
m_sConnStr = "Provider=Micro soft.Jet.OLEDB. 4.0;Data Source='" &
App.Path & "\Indices.mdb'; "
Set oConnection1 = New ADODB.Connectio n
oConnection1.Cu rsorLocation = adUseClient
oConnection1.Op en m_sConnStr
sSQL = "SELECT NAME FROM TblTotal WHERE NAME LIKE '%MSCI%' AND
DSCD LIKE 'return records starting with capital only'"
Set m_oRecordset = New ADODB.Recordset
m_oRecordset.Op en sSQL, oConnection1, adOpenStatic,
adLockReadOnly, adCmdText
Label7.Caption = m_oRecordset.Re cordCount
I'm using Jet to connect to an Access 2002 db. All the sql requests
I've tried so far have worked so far but I've now hit a brick wall.
I have a table with a column DSCD which contains identifiers in the
format 'A00000' where A is either upper case or lower case letter
followed by a 5 digit number.
The problem I'm having is that i want to count the number of records
which start with a capital letter. I've tried so many different ways
but always get back a count including the lowercase records.
Somebody please put me out of my misery!!!
Private Sub Form_Load()
m_sConnStr = "Provider=Micro soft.Jet.OLEDB. 4.0;Data Source='" &
App.Path & "\Indices.mdb'; "
Set oConnection1 = New ADODB.Connectio n
oConnection1.Cu rsorLocation = adUseClient
oConnection1.Op en m_sConnStr
sSQL = "SELECT NAME FROM TblTotal WHERE NAME LIKE '%MSCI%' AND
DSCD LIKE 'return records starting with capital only'"
Set m_oRecordset = New ADODB.Recordset
m_oRecordset.Op en sSQL, oConnection1, adOpenStatic,
adLockReadOnly, adCmdText
Label7.Caption = m_oRecordset.Re cordCount
Comment