Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
LIKE operataor
Message
 
À
26/09/2001 11:43:06
Alex Zhadanov
Computer Generated Solutions
New York City, New York, États-Unis
Information générale
Forum:
Visual Basic
Catégorie:
Bases de données DAO/RDO/ODBC/ADO
Titre:
Divers
Thread ID:
00561030
Message ID:
00561295
Vues:
14
Replace the * with a % when querying from VB.


>Hi,All.
>I have problem with LIKE operator in select statement in ADO with Access Data base.
>When i run such :select * from table where companyname like 'A*' from inside
>access query everything works ok.But it 's not working when i try to create
>recordset:
> ssql = "select * from table where companyname like 'A*'"
> Set rsleaves = New ADODB.Recordset
> rsleaves.CursorLocation = adUseClient
> rsleaves.Open sSql, cn, adOpenStatic, adLockReadOnly
>But if i open recordset with all records and apply filter it works fine.
> ssql = "select * from table "
> Set rsleaves = New ADODB.Recordset
> rsleaves.CursorLocation = adUseClient
> rsleaves.Open sSql, cn, adOpenStatic, adLockReadOnly
> rsleaves.filter = "companyname like 'A*'"
>Why it happened?
>Thank you
>Alex
Éric Moreau, MCPD, Visual Developer - Visual Basic MVP
Conseiller Principal / Senior Consultant
Moer inc.
http://www.emoreau.com
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform