I have a VB6 SP4 project connecting via OLE DB to an Oracle 8i EE database.

We are trying to retrieve all of the records from a table that meet a certain criteria. When our SQL statement reads:

A) select ACTIVITY, CONTROLNO, RIGNO from FAILURES where ACTIVITY='XYZ';

we get a resultset, but that resultset is not what we really want. The records that we really want are the ones where the CONTROLNO values start with a certain string (the Activity name). My first approach was:

B) select ACTIVITY, CONTROLNO, RIGNO from FAILURES where controlno like 'XYZ%';

This results in no records when executed in VB. However, copying this SQL statement to SQL Plus and it results, correctly, in 4 records.

Does anyone have a clue? I even tried using the underscores (there are 6 trailing characters), but it also worked in SQL Plus while not working in VB.

TIA