Help. Urgent 
Author Message
 Help. Urgent

Hi,
Please help.
I am using  VB 6.0 and SQL Server 6.5
Using ADO for the connection.
If I have a name D'Souza in the database, how can I fire a query based on
this criteria?
I used -
rs.open "select * from pub_info where name = 'D'Souza'"

But this didn't work as it got confused in the apostroph used in the name.
How should I query based on these values in the database?
Any help would be appreciated.
Thanks in aniticipation.
Regards,
Purnima



Tue, 04 Sep 2001 03:00:00 GMT  
 Help. Urgent
rs.open "select * from pub_info where name = 'D''Souza'"

--
HTH

VB-Joker
MCSE

PLEASE post ALL replies to newsgroup!

Quote:
> Hi,
> Please help.
> I am using  VB 6.0 and SQL Server 6.5
> Using ADO for the connection.
> If I have a name D'Souza in the database, how can I fire a query based on
> this criteria?
> I used -
> rs.open "select * from pub_info where name = 'D'Souza'"

> But this didn't work as it got confused in the apostroph used in the name.
> How should I query based on these values in the database?
> Any help would be appreciated.
> Thanks in aniticipation.
> Regards,
> Purnima




Tue, 04 Sep 2001 03:00:00 GMT  
 Help. Urgent
Not quite so simple, I'm afraid. I once worked on an application where ships
names had to appear inside double quotes, and sometimes a ship's name had an
apostrophe, e.g. "H.M.S. O'Grady". It was a few years ago, but we never did
find a way around this. (it was a sybase app, but SQL server is not really
any different)

In the end we translated all single quotes into spanish "e"'s, and all
double quotes into something else, before we wrote to the database. Then we
had to translate when we read the data back. Yeuchh! I'd be interested to
see if anyone knows a better way (there must be one!)

Quote:

>rs.open "select * from pub_info where name = 'D''Souza'"



Tue, 04 Sep 2001 03:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. FTP Problem PLEASE HELP!!! URGENT

2. I NEED HELP !!!! URGENT PLEASE

3. Please help ...... urgent .strange error

4. Please Help.. Urgent

5. Help! URGENT

6. Help!! Urgent:: VB5

7. Please help!! Urgent

8. Help!!!!! (URGENT)

9. Help. Urgent

10. !HELP! Urgent Import Excel values to a ListBox

11. HElp !! urgent

12. Form in Form Help! Urgent

 

 
Powered by phpBB® Forum Software