Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
ADO, CURSORADAPATER and Parameters
Message
 
À
30/12/2004 06:28:00
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Versions des environnements
Visual FoxPro:
VFP 9
OS:
Windows Server 2003
Network:
Windows 2003 Server
Database:
MS SQL Server
Divers
Thread ID:
00973221
Message ID:
00973465
Vues:
22
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?
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform