Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
ADO, CURSORADAPATER and Parameters
Message
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Environment versions
Visual FoxPro:
VFP 9
OS:
Windows Server 2003
Network:
Windows 2003 Server
Database:
MS SQL Server
Miscellaneous
Thread ID:
00973221
Message ID:
00973465
Views:
21
Hi Tim,


There are a number of reasons in this case. The main one in this case is that I need to pass Unicode data that gets encoded and that data can never be 'expanded' in VFP to a string or you'll loose the encoding. A parameter is needed here so that a UTF-8 encoded string can be passed to an ADO parameter object. I can't embed Unicode or UTF-8 as a literal and have Sql Server deal with it, but ADO can deal with it and turn it into Unicode to pass it an nText or nVarchar field.

Also, literals are a bad idea for many more pedestrian reasons in general. SQL Injection, the need to deal with ' characters to name a couple.

+++ Rick ---


>Am I missing something fundamental here?
>
>If it works with a literal SQL statement, why not just
>
>
>pcDescript = "English"
>lcSQL = "SELECT Id,Descript,lDescript,lDescriptBin from ForeignData where descript='" + ALLTRIM(pcDescript) + "'"
>

>
>You'll need to check pcDescript if it's entered by the user at it could potentially contain extra SQL clauses. SQL insertion has had me once before
>
>Like I said, this might be me barking up the wrong tree
+++ Rick ---

West Wind Technologies
Maui, Hawaii

west-wind.com/
West Wind Message Board
Rick's Web Log
Markdown Monster
---
Making waves on the Web

Where do you want to surf today?
Previous
Reply
Map
View

Click here to load this message in the networking platform