Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Saving unicode data
Message
 
 
To
26/12/2011 13:27:53
General information
Forum:
Visual FoxPro
Category:
ActiveX controls in VFP
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows 7
Network:
Windows 2003 Server
Database:
MS SQL Server
Miscellaneous
Thread ID:
01531693
Message ID:
01531703
Views:
67
>>>Why would you convert it back ?
>>>
>>>If you assign it the data from the table, and it displays well, then the format is ok - I'd say
>>
>>I can select CONVERT(varbinary(max), MyNvarcharField) in VFP and I can then assign it to the textbox.text - this part works.
>>
>>However, trying
>>
>>replace myField with ActiveX.Text
>>
>>update myTable set myNvarcharField = convert(nvarchar(100), ?myVFPCursor.MyField)
>>
>>does not work.
>>
>>I don't know what to try. Wondering, if someone can try the same experiment I'm trying - it should be very simple to set it up. Create a SQL Server table with the nvarchar(100) field. Insert in SSMS any unicode data into this field.
>>
>>Thanks a lot in advance if someone can help me out.
>
>
>I hope your vfp cursor field is binary, ie NOCPTRANS

Let me verify that, but this is the exact code I have in form's DE:
nodefault
set multilocks on					&&necessary for all types of buffering
cursorsetprop("MapBinary", .T., 0)
LOCAL lcSQL
TEXT TO lcSQL
SELECT pri_key      
      ,defltlang
      ,cast(language00 as varbinary(100)) as language00
      ,lngimage00
      
      ,cast(language01 as varbinary(100)) as language01
      ,lngimage01
      ,cast(language02 as varbinary(100)) as language02
      ,lngimage02
      ,cast(language03 as varbinary(100)) as language03
      ,lngimage03
      ,cast(language04 as varbinary(100)) as language04
      ,lngimage04
      ,cast(language05 as varbinary(100)) as language05
      ,lngimage05
      ,cast(language06 as varbinary(100)) as language06
      ,lngimage06
      ,cast(language07 as varbinary(100)) as language07
      ,lngimage07
      ,cast(language08 as varbinary(100)) as language08
      ,lngimage08
      ,cast(language09 as varbinary(100)) as language09
      ,lngimage09
      ,cast(language10 as varbinary(100)) as language10
      ,lngimage10      
  FROM dbo.prefs_sl
endtext  
mysqlexec(m.lcSQL, 'prefs_sl', program())

select prefs_sl
if reccount()=0
  append blank 
ENDIF

*!*	SELECT pri_key, defltlang, ;
*!*	CAST(STRCONV(language00,10) as M) as language00, ;
*!*	CAST(STRCONV(language01,10) as M) as language01, ;
*!*	CAST(STRCONV(language02,10) as M) as language02, ;
*!*	CAST(STRCONV(language03,10) as M) as language03, ;
*!*	CAST(STRCONV(language04,10) as M) as language04, ;
*!*	CAST(STRCONV(language05,10) as M) as language05, ;
*!*	CAST(STRCONV(language06,10) as M) as language06, ;
*!*	CAST(STRCONV(language07,10) as M) as language07, ;
*!*	CAST(STRCONV(language08,10) as M) as language08, ;
*!*	CAST(STRCONV(language09,10) as M) as language09, ;
*!*	CAST(STRCONV(language10,10) as M) as language10, ;
*!*	lngImage00, ;
*!*	lngImage01, lngImage02, lngImage03, lngImage05, lngImage05, ;
*!*	lngImage06, lngImage07, lngImage08, lngImage09, lngImage10 ;
*!*	from prefs_sl into cursor prefs1_sl readwrite
If it's not broken, fix it until it is.


My Blog
Previous
Reply
Map
View

Click here to load this message in the networking platform