-1

I tried several "Like" syntax on one request, (I'm using VB.NET and a MS-ACCESS 2010 database), and none of them could get any other result than throwing an exception.Why? I'm not having any idea about that.

I did this workaround : Instead of

SELECT dbFieldDisplayName FROM dbTableName WHERE dbFieldSearchName Like 'A*'

(I also tried with 'A%' instead of 'A*')

I Used:

SELECT dbFieldDisplayName 
FROM dbTableName 
WHERE dbFieldSearchName >='A' AND dbFieldSearchName <'AZZZ'

Does anybody know why my Like statement always triggers exception? Any better workaround ?

Thanks in advance.

C. MARIN
  • 95
  • 9

2 Answers2

3

If you need the rows with col values startin with A you should use like with %

SELECT dbFieldDisplayName FROM dbTableName WHERE dbFieldSearchName Like 'A%'

(in SQL * ...mean all columns ..not all char)

ScaisEdge
  • 131,976
  • 10
  • 91
  • 107
1

Finally, what a strange behaviour of my MS-ACCESS...

I uninstalled all my office components (including MS-ACCESS), and installed it all again, and now the 'Like' statement works fine, with a % as a wildcard.

The request:

SELECT dbFieldDisplayName FROM dbTableName WHERE dbFieldSearchName Like 'A%'

works now fine, as it was supposed to be working.

C. MARIN
  • 95
  • 9