Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsVB SyntaxEnterprise DevelopmentDatabase AccessControlsCOMWin APICrystal ReportDeploymentGeneralGeneral 2
Related Topics
VB.NET / ASP.NETMS SQL ServerMS AccessOther Database ProductsMore Topics ...

VB Forum / General / November 2004



Tip: Looking for answers? Try searching our database.

Using LIKE to match a file name.

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Keith Gardner - 26 Nov 2004 05:21 GMT
Greetings:

I have a hyperlink field which contains the path and file name of a pdf
document (5.065-s.pdf) which I'm trying to look for in another table
that also has a hyperlink field containing a path and file name.

I'm using the Like operator to just look for the file name from the
first recordset in the second recordset, but I can't get it to work. I
know the file is there, but I can't do it in VBA code or in the QBE
grid. I've tried:

Like 5.065-s.pdf
Like *5.065-s.pdf
Like *5.065-s.pdf*
Like *"5.065-s.pdf"*
Like "*5.065-s.pdf*"

All to no avail. Are the dots and hyphens being interpreted as special
characters?

TIA

Keith
Jeff Johnson [MVP: VB] - 26 Nov 2004 05:52 GMT
> I'm using the Like operator to just look for the file name from the
> first recordset in the second recordset, but I can't get it to work.

ADO? Use the % and _ wildcards instead of * and ?.
Keith Gardner - 26 Nov 2004 06:21 GMT
Thanks for the reply.

I'm using DAO.

Are comparisons of hyperlink fields different than regular fields? To
set them I had to use:

field = "#hyperlink address#"

That sets just the hyperlink text, but that is also what is displayed in
the textbox. So does that mean I have to use some different syntax in
the Like statement to get it to look at the hyperlink address?

Or, as I asked previously, are the symbols in the file name (-.) causing
a problem with Like?

Thanks again

Keith
Jeff Johnson [MVP: VB] - 26 Nov 2004 22:25 GMT
> I'm using DAO.
>
> Are comparisons of hyperlink fields different than regular fields?

At this point I think you'd be better served asking in one of the
microsoft.public.access.* newsgroups. Are you using full-blown VB (which
this group is for) or VBA under Access?
Dave - 30 Nov 2004 09:46 GMT
It would help to see the entire line with the LIKE constraint and any error
messages you get, but try this:
LIKE '*5.065-s.pdf*'

note: apostrophes instead of quotes.

Dave

> Greetings:
>
[quoted text clipped - 22 lines]
> *** Sent via Developersdex http://www.developersdex.com ***
> Don't just participate in USENET...get rewarded for it!
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.