Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Help on SQL To VFP Please!!!
Message
 
 
To
23/07/2002 00:57:19
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00681474
Message ID:
00681552
Views:
15
Hi Ric,

To convert binary data to something meaningfull you've to know what is stored there and in what format. To convert it to hexadecimal string.
lcHex = ""
FOR i=1 TO LEN(lcStr)
  lcHex = lcHex + RIGHT(TRANSFORM(ASC(SUBSTR(entity_id, i,1)), "@0"),2)
ENDFOR
? lcHex
>Okay, hello and thanks in advance. I have a bit of a problem here, on a time crunch. I have a valid connection and loadout from an SQL data source, into a VFP cursor. Eventually, to dump into a database, but right now, just to list a report of certain key data items of the SQL source. However, one of the KEY data items, which needs to be reported, displayed is an SQL field, binary, contained in a memo field (aahhh!!!!).
>
>So, my question is how do we convert the binary memo data into some vfp value, string or numeric?? I have tried repeatedly the BINTOC(), but not with any luck. Here is what I have as a test:
>
>*-- this works
>ln1 = 0
>lnConnHandle = SQLStringConnect('DRIVER=sql server;SERVER=shiva;UID=sa;PWD=;DATABASE=methodistcrm')
>
>*-- this works
>lcSQL = 'SELECT * FROM entity ORDER BY entity_key'
>lcCursor = '_mytable'
>
>*-- this works
>DO WHILE ln1 = 0
> ln1=SQLEXEC(lnConnHandle, lcSQL, lcCursor)
>ENDDO
>
>*-- Okay, the data is now in a cursor
>SELECT (lcCursor)
>
>SCAN
> *-- this is all mucky!!
> lnIndex = entity_id
> lnNewIndex = BINTOC(lnIndex)
> SKIP
>ENDSCAN
>

>*-- just to tidy up
>ln2=SQLDISCONNECT(lnConnHandle)

>
>Any suggestions? again, TIA!!!
>
>Ric
--sb--
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform