Reading and converting Character (binary) datatype data from V FoxPro 
Author Message
 Reading and converting Character (binary) datatype data from V FoxPro

Fellow developers,

I recently posted a question asking if anyone knew how to convert
"Character (binary)" type
data selected back from a VFP database into something readable by VB.
After I tried a lot of things
like playing with StrConv() and the "BLOB to Text File" functions in the
MS KB, Msoft Support came up
with an answer.  You have to add two single quote chars and a "+" before
the name of the field
holding the "Character (binary)" type data in the SQL query, as in:

' These are 2 single quotes---V
rs.Open    "Select usr_lanid, ''+usr_password as usr_password FROM
users", _
        cnMain, adOpenStatic, adLockReadOnly

where the field usr_password is of the "Character (binary)" data type.
The data returned
as usr_password will be readable by VB string-reading functions.

Why this would work, I don't know.  I will take an educated guess that
by adding ''+ to the
field, you are signaling the OLE DB driver that the field is of
"Character (binary)" type and
to cast is at a string.  But that is only a guess; who knows what it
actually does. (Hey, does
anyone out there know??)

This is definitely one for the Msoft Knowledge Base.

Matt



Fri, 28 Sep 2001 03:00:00 GMT  
 
 [ 1 post ] 

 Relevant Pages 

1. Reading and converting Character (binary) datatype data from V FoxPro

2. Reading and converting Character (binary) datatype data from V FoxPro

3. Reading and converting Character (binary) datatype data from V FoxPro

4. HOW CAN I READ AND CONVERT BINARY DATA VIA COM

5. Converting datatype varchar to datatype datetime in SQL trigger

6. convert binary data to string data

7. VB6 - Read the first character from a binary file

8. Question about reading files binary vs random.

9. Write data in binary file / Convert Image

10. Converting Binary Seconds Into Data/Time

11. convert into binary data

12. Converting Binary data with VB4.0 or VB5.0

 

 
Powered by phpBB® Forum Software