Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Avoid codepage conversion in SPT
Message
 
 
To
05/08/2009 19:28:40
Dragan Nedeljkovich (Online)
Now officially retired
Zrenjanin, Serbia
General information
Forum:
Visual FoxPro
Category:
Client/server
Environment versions
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP2
Miscellaneous
Thread ID:
01416376
Message ID:
01416382
Views:
47
Did you try running this as an SP and use nvarchar() or nchar or varbinary parameters?

>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?
If it's not broken, fix it until it is.


My Blog
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform