Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Single and Double Quotes in SQL Statement....
Message
 
À
08/02/2001 07:09:15
Information générale
Forum:
Visual Basic
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00473844
Message ID:
00473868
Vues:
18
>Hi Friends,
>
>I have some problem while executing a SQL statement in recordset....
>Let me explain it in short....
>
>Some code sample to search and open recordset for a particular client is ...
>
>1. Set rsDataCl = ExportFromDB.OpenRecordset("SELECT * FROM Client_Info WHERE Client_Info.Case_Name IN (" & SelectedCases & ")", dbOpenDynaset)
>
>2.rsNewCase.FindFirst "Case_Name = '" & rsDataCl!Case_name & "'"
>
>3. SQL = "Select * from Client_Info where Client_Info.Case_Name = '" & rsDataCl!Case_name & "'"
> Set rsClientInfo = ExportDB.OpenRecordset(SQL, dbOpenDynaset)
>
>where selectedcases = ' orei'lly','"""' ' """', 'oh my' god'
>
>and rsDataCl!Case_name can be any of these 3 names...
>
>The problems I am encountering is when the case name contains a combination of single ' ( single inverted comma ) and "" a
>
>If you can think of a quick solution to overcome this then it would be a great help.I have tried querydef but using this will be a pain in the neck with a lot of work going through this. If there is something very obvious which I am missing , I will be very grateful if you can point this out. Other wise I will be killed going through the query defs changing it every where to make a small thing as a single ' working....maybe it would be better that then I just put a stop to case names with a single ' with some validations in the text box ...:-)
>
>Thanks in advance.....
>Shilpa
Éric Moreau, MCPD, Visual Developer - Visual Basic MVP
Conseiller Principal / Senior Consultant
Moer inc.
http://www.emoreau.com
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform