LIKE Operator not working as with access 97 
Author Message
 LIKE Operator not working as with access 97

in a VB project, i have an ADO command with SQL code:
    DELETE FROM myTABLE


In Access, I can have
    PARAMETERS MyParam Text;
    DELETE * FROM myTABLE
    WHERE MyColumn Like MyParam & "*";

But then I don't know how to pass the argument through an ADO Stored
Procedure.

Q1    Why is the code not working in the ADO Command
Q2    If there is no way, how can i implement the stored procedure  and if
CallSyntax is involved, What is the CallSyntax syntax. I Couldn't find any
help in the VS6.0 help
Q3    Maybe there could be another way to delete lines using such a
parameter...

Please answer in the newsgroup. Thanks in advance
--
You can write in French, English and Spanish
Aymeric le Gouvello de la Porte

ICQ: 27357591



Sun, 04 Aug 2002 03:00:00 GMT  
 LIKE Operator not working as with access 97
Try like this example :
" WHERE Name Like '[A-D]*';"
That gives all the name starting with A to D
Quote:

> in a VB project, i have an ADO command with SQL code:
>     DELETE FROM myTABLE


> In Access, I can have
>     PARAMETERS MyParam Text;
>     DELETE * FROM myTABLE
>     WHERE MyColumn Like MyParam & "*";

> But then I don't know how to pass the argument through an ADO Stored
> Procedure.

> Q1    Why is the code not working in the ADO Command
> Q2    If there is no way, how can i implement the stored procedure  and if
> CallSyntax is involved, What is the CallSyntax syntax. I Couldn't find any
> help in the VS6.0 help
> Q3    Maybe there could be another way to delete lines using such a
> parameter...

> Please answer in the newsgroup. Thanks in advance
> --
> You can write in French, English and Spanish
> Aymeric le Gouvello de la Porte

> ICQ: 27357591



Sun, 04 Aug 2002 03:00:00 GMT  
 LIKE Operator not working as with access 97
Hi,
  you could try with the % operator instead of the *.  I'm not sure with
access DB but it works with Oracle.

Joel Lord

Quote:

>in a VB project, i have an ADO command with SQL code:
>    DELETE FROM myTABLE


>In Access, I can have
>    PARAMETERS MyParam Text;
>    DELETE * FROM myTABLE
>    WHERE MyColumn Like MyParam & "*";

>But then I don't know how to pass the argument through an ADO Stored
>Procedure.

>Q1    Why is the code not working in the ADO Command
>Q2    If there is no way, how can i implement the stored procedure  and if
>CallSyntax is involved, What is the CallSyntax syntax. I Couldn't find any
>help in the VS6.0 help
>Q3    Maybe there could be another way to delete lines using such a
>parameter...

>Please answer in the newsgroup. Thanks in advance
>--
>You can write in French, English and Spanish
>Aymeric le Gouvello de la Porte

>ICQ: 27357591



Sun, 04 Aug 2002 03:00:00 GMT  
 LIKE Operator not working as with access 97

Try:

Quote:
>    DELETE FROM myTABLE


But remove spaces between ' and " characters


Sun, 04 Aug 2002 03:00:00 GMT  
 LIKE Operator not working as with access 97
Shouldn't it be '%' and not '*'?
Incidentally, In Access97, with a SQL7 backend, a standard select query with
the '*' doesn't work, nor does the '%'
It seems you have to use a pass-through query with '%'



Quote:
> in a VB project, i have an ADO command with SQL code:
>     DELETE FROM myTABLE


> In Access, I can have
>     PARAMETERS MyParam Text;
>     DELETE * FROM myTABLE
>     WHERE MyColumn Like MyParam & "*";

> But then I don't know how to pass the argument through an ADO Stored
> Procedure.

> Q1    Why is the code not working in the ADO Command
> Q2    If there is no way, how can i implement the stored procedure  and if
> CallSyntax is involved, What is the CallSyntax syntax. I Couldn't find any
> help in the VS6.0 help
> Q3    Maybe there could be another way to delete lines using such a
> parameter...

> Please answer in the newsgroup. Thanks in advance
> --
> You can write in French, English and Spanish
> Aymeric le Gouvello de la Porte

> ICQ: 27357591



Wed, 07 Aug 2002 03:00:00 GMT  
 LIKE Operator not working as with access 97
I had the same problem. And have not resolved it.  But I am now using the
DAO control and it works fine.

Regards,
Michael



Quote:
> in a VB project, i have an ADO command with SQL code:
>     DELETE FROM myTABLE


> In Access, I can have
>     PARAMETERS MyParam Text;
>     DELETE * FROM myTABLE
>     WHERE MyColumn Like MyParam & "*";

> But then I don't know how to pass the argument through an ADO Stored
> Procedure.

> Q1    Why is the code not working in the ADO Command
> Q2    If there is no way, how can i implement the stored procedure  and if
> CallSyntax is involved, What is the CallSyntax syntax. I Couldn't find any
> help in the VS6.0 help
> Q3    Maybe there could be another way to delete lines using such a
> parameter...

> Please answer in the newsgroup. Thanks in advance
> --
> You can write in French, English and Spanish
> Aymeric le Gouvello de la Porte

> ICQ: 27357591



Sat, 10 Aug 2002 03:00:00 GMT  
 LIKE Operator not working as with access 97
Using ADO, the wildcard character is %, not *

Quote:

> I had the same problem. And have not resolved it.  But I am now using the
> DAO control and it works fine.

> Regards,
> Michael



> > in a VB project, i have an ADO command with SQL code:
> >     DELETE FROM myTABLE


> > In Access, I can have
> >     PARAMETERS MyParam Text;
> >     DELETE * FROM myTABLE
> >     WHERE MyColumn Like MyParam & "*";

> > But then I don't know how to pass the argument through an ADO Stored
> > Procedure.

> > Q1    Why is the code not working in the ADO Command
> > Q2    If there is no way, how can i implement the stored procedure  and if
> > CallSyntax is involved, What is the CallSyntax syntax. I Couldn't find any
> > help in the VS6.0 help
> > Q3    Maybe there could be another way to delete lines using such a
> > parameter...

> > Please answer in the newsgroup. Thanks in advance
> > --
> > You can write in French, English and Spanish
> > Aymeric le Gouvello de la Porte

> > ICQ: 27357591

--

Beer, Wine and Database Programming.  What could be better?
Visit "Doug Steele's Beer and Programming Emporium"
http://webhome.idirect.com/~djsteele/



Sun, 11 Aug 2002 03:00:00 GMT  
 
 [ 7 post ] 

 Relevant Pages 

1. DLL usage - works in Access 97 but not in Access 2000

2. VB expressions do not work properly in different installations of Access 97

3. Parameterized Update query not working correctly in Access 97

4. Access 97 - Application.Quit does not work if msgbox is displayed

5. Access 97 RecordsetClone not working for Date

6. DeleteObject not working with Access 97

7. Correlated subquery in DELETE stmt not work in Access '97 or 2000

8. ADO OLEDB will not work on Access 97

9. Visdata Grid not working with Access 97

10. Microsoft.Jet.OLEDB.4.0 Provider not working with Access 97 MDB

11. Access 97 AddressOf Operator

12. Program from access 97 won't work in access 2000

 

 
Powered by phpBB® Forum Software