Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Key in apostrophe
Message
From
16/09/2004 18:20:07
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
 
To
15/09/2004 20:32:15
Yh Yau
Ingenuity Microsystems Sdn Bhd
Kuala Lumpur, Malaysia
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00942689
Message ID:
00943149
Views:
21
>VFP6 SP5. Using sqlexec() to insert records into SQL server database. How to allow "'" or quotes to be entered?
>The syntax use is :-
>lcsqlstring = "Something with ' "
>Thanks in advance.
>Yau

Yau,
To pass a single quote to SQL server you've to type it twice. ie:

lcsqlstring = "Something with '' "

if you're doing it like:

SQLExec(handle, "insert into myTable (myField) values ('"+lcString+"')")

But there is a simplier way:

lcsqlstring = "Something with ' " && as you do already

SQLExec(handle, "insert into myTable (myField) values (?m.lcString)")

Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Previous
Reply
Map
View

Click here to load this message in the networking platform