hot to use instr function in DAO

Pernia

New member
Local time
Yesterday, 18:05
Joined
Nov 19, 2009
Messages
5
hi guys:)
i don't know how should i use substr functions such as substr or instr
in a dao sql query!!!
for exampe:
Select * from Table1 where instr(1,field1,'martin')>0
it doesn't work in vb6 dao(SP6) but it could run in access in one query:confused:.
 
I'm not sure what you mean by does work and doesn't work. Is doesn't work accompanied by an error message? Nuclear explosion? What?

Since you really didn't give us much information, I'll answer generally with a discussion:

If you stop and think about it a while, Access is an integrated environment of a powerful programming language (VBA) and a pretty stable and complete DBMS (Jet). The cool thing about such a setup is that you can use VBA functions inside your SQL, as long as you're inside the Access (Jet) environment. Once you try to send that same SQL to an environment where there is no built in VBA, the DBMS doesn't know what to do with the (to it) unknown functions.
 
ANOTHER THING to add is the substr() function. is that even a vb function?
 
problem solved.
i think instead of using instr function we can use Like in DAO.
because it is possible to use VBA Functions just inside access Query , Not from vb6's DAO commands.
thanx guys
 
Yes, the thing to remember is VB6 is SIMILAR to VBA and certain functions are available within the context of queries in Access that aren't available in other programming tools.
 

Users who are viewing this thread

Back
Top Bottom