Programming Forums

Programming Forums (http://www.programmingforums.org/forumindex.php)
-   Visual Basic (http://www.programmingforums.org/forum18.html)
-   -   Reading a string (http://www.programmingforums.org/showthread.php?t=11298)

dmcl2000 Sep 12th, 2006 6:18 AM

Reading a string
 
Hi there!
Can anyone help me maybe with a small snippet of code. I am reading a string variable from a text file. The string may contain an aphostrophe which causes errors when I try to use it within a SQL query string command.

dmcl2000 Sep 12th, 2006 6:20 AM

I should have added the code is in VB6

ReggaetonKing Sep 12th, 2006 11:02 AM

Try checking to see if the string has any special characters before you use it in the SQL query.

Ooble Sep 12th, 2006 9:37 PM

Most databases have their own functions to escape a string so it can be used in a query. Find out what the function is in VB 6 for your database.

dmcl2000 Sep 13th, 2006 6:14 AM

Many thanks folks. As an update I will not be importing the errant string as it duplicates other data in the database. This was my first post and I'm impressed at the quick response


All times are GMT -5. The time now is 11:23 PM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC