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 2 / April 2004



Tip: Looking for answers? Try searching our database.

Quote symbol problem W98 vs W2000

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Meyer1228 - 30 Apr 2004 15:03 GMT
Our VB program has a feature where if a product item number button is
clicked, it searches in a particular folder for a jpeg image of that item
and displays it on a form.    We have an on error condition that if the jpeg
isn't found the form still pops up, but it is blank.

Our database is old, however, and it allowed quotes within the item number,
to represent inches or feet.  We can't have a jpeg file name with quotes in
it, as a file with a quote is not allowed in Windows.  On a W98 machine, if
such an item is clicked, a blank form pops up, triggered by the on error.
But on a W2000 machine, we don't even get the on error; it gives us a sql
error.  We're no longer allowing a quote symbol in our item numbers, but
until then, does anyone have any suggestions for a workaround?
EBS - 30 Apr 2004 15:45 GMT
Kathy,

The problem is that a single quote is used as a string delimiter in an SQL
statement.

You can write a simple function to replace any single quote with *two*
single quotes in your SQL statement.
So, an item number like this: ITEM123 - 2' becomes: ITEM123 - 2'' <-- two
single quotes, NOT a double quote!
This should eliminate the SQL error and allow you to use item numbers with
single quotes in them.

Regards,
Eric

>Our VB program has a feature where if a product item number button is
>clicked, it searches in a particular folder for a jpeg image of that item
[quoted text clipped - 8 lines]
>error.  We're no longer allowing a quote symbol in our item numbers, but
>until then, does anyone have any suggestions for a workaround?
 
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.