Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
SELECT * FROM and the apostrophe
Message
 
À
15/10/1999 09:33:58
Information générale
Forum:
Visual Basic
Catégorie:
VBScript
Divers
Thread ID:
00276634
Message ID:
00276869
Vues:
29
>Eric this is what I did and the error I got,
>
>C_BusinessName="Bob's Funny Farm"
>sqlQuery2 = "SELECT * FROM CustomerInfo WHERE BusinessName='"&C_BusinessName&"'"
>set objRec2 = Server.CreateObject("ADODB.Recordset")
>objRec2.open sqlQuery2, objCmd, adOpenKeyset, adLockOptimistic, adCmdText
>
>and upon load the ASP page I got the next error:
>
>Microsoft OLE DB Provider for SQL Server error '80040e14'
>Line 1: Incorrect syntax near 's'.
>/sgtest.asp, line 15

Try this:
C_BusinessName=replace("Bob's Funny Farm", "'", "''")
É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