Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
VFPOLEDB adds chr(0) at end of memos
Message
From
10/02/2011 12:36:30
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:
01499632
Message ID:
01499667
Views:
56
>>Experimenting with pulling dbfs into SQL database, via select * from openrowset(...), I've found that ALL of the memo fields have been migrated with an extra chr(0) in the end.
>>
>>Googling a subject where your keywords are "null", "null terminated string", "vfpoledb" and such gives an incredible amount of fun, seeing how many completely unrelated things pop up, and an even larger amount of frustration.
>>
>>So... the question: did anyone encounter this before? If not, is there a good place with information on how VFPOLEDB can be configured? Or, at least, what can go into the provider string to change this behavior?
>
>
>If memo or char field contain CHR(0), the field type on SQL must be binary and in query you must convert memo/char to
image(varbinary(max))/varbinary.

This is the opposite problem. The fields are just text; when imported from VFP into SQL via openrowset(), they end up having a chr(0) added at the end. Something along the chain thinks this is supposed to be a null terminated string.

Problem temporarily solved by using ODBC driver instead, but I'd still like to know what's causing this and whether it can be avoided.

back to same old

the first online autobiography, unfinished by design
What, me reckless? I'm full of recks!
Balkans, eh? Count them.
Previous
Reply
Map
View

Click here to load this message in the networking platform