![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Newbie
Join Date: Dec 2005
Posts: 3
Rep Power: 0
![]() |
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. |
|
|
|
|
|
#2 |
|
Newbie
Join Date: Dec 2005
Posts: 3
Rep Power: 0
![]() |
I should have added the code is in VB6
|
|
|
|
|
|
#3 |
|
Sexy Programmer
|
Try checking to see if the string has any special characters before you use it in the SQL query.
__________________
I would love to change the world, but they won't give me the source code! |
|
|
|
|
|
#4 |
|
I eat cake for breakfast.
![]() ![]() ![]() ![]() Join Date: Jul 2004
Location: In my box.
Posts: 4,434
Rep Power: 9
![]() |
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.
|
|
|
|
|
|
#5 |
|
Newbie
Join Date: Dec 2005
Posts: 3
Rep Power: 0
![]() |
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
|
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| C# corruption!!! | Kilo | C++ | 32 | May 21st, 2006 8:44 PM |
| Reading string with unknown substring | treeninja | Delphi | 3 | Feb 8th, 2006 12:26 PM |
| Array issues :( | Alo Tsum | Java | 10 | Nov 26th, 2005 5:45 PM |
| replace space with ' * ' | TecBrain | C++ | 15 | Apr 13th, 2005 12:32 PM |
| function | solomon_13000 | Java | 6 | Apr 2nd, 2005 11:42 PM |