Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Avoid codepage conversion in SPT
Message
De
06/08/2009 03:43:56
 
 
À
05/08/2009 19:28:40
Dragan Nedeljkovich (En ligne)
Now officially retired
Zrenjanin, Serbia
Information générale
Forum:
Visual FoxPro
Catégorie:
Client/serveur
Versions des environnements
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP2
Divers
Thread ID:
01416376
Message ID:
01416402
Vues:
76
This message has been marked as the solution to the initial question of the thread.
>When VFP operates in one codepage (1250 in this case) and the SQL server has fields defined in SQL_Latin1_General_CP1_CI_AS... some binary fields get screwed along the way.
>
>Is there a way to avoid the conversion which happens when a value is passed via a SPT call? The value stored serverside is converted, which in case of non-Western values (which exist, nevertheless) means the data is screwed up.
>
>So far the only way I've found is to make the field binary on SQL side, which isn't easy to do, it takes a script like this:
>
>
>EXEC sys.sp_unbindefault N'[dbo].[myTable].[myField]'
>alter table myTable add myField2 [binary](20) null
>update myTable set myField2=convert(binary(20), myField) where 1=1
>alter table myTable drop column myField
>alter table myTable add myField [binary](20) null
>update myTable set myField=myField2 where 1=1
>alter table myTable drop column myField2
>EXEC sp_bindefault N'[dbo].[Dflt_EmptyString]', N'[myTable].[myField]'
>
>That's eight lines per field... ugly. Any way to set something VFP side, or in the connectstring, to tell ODBC to ignore codepages and just shut up about conversions?

Try

Add
AutoTranslate=NO
into the connection string.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform