Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Store image file via ADO with DCOM
Message
 
 
À
21/02/2001 20:03:33
Information générale
Forum:
Visual FoxPro
Catégorie:
COM/DCOM et OLE Automation
Divers
Thread ID:
00478246
Message ID:
00478364
Vues:
19
Hi!

On the SQL Server you have to use image field type. ADO handles it automatically, in ADO you can get a binary data from that field using methods of the field object for binary data fields. On the client side you need some way to move that data to the VFP general field, otherwise you will require to completely change the approach you use for working with images. To put it into general field do following:
- Get data from the ADO object and put it into the string
- create temporary table on disk with only one single field with memo type
- make new record in the table and store binary data string into the memo field
- close table and use fopen/fwrite/fclose functions to change field type from the memo to general on the low level
- open table and now you have a general field over which you can use Modify General, show that field in the report or OLEBoundControl object.

To write data do opposite - save general field in the temporary table with only one field, change field type to memo, get content of field as a string and put it into the binary data field of the ADO object and than send that ADO object to your COM server for updates of image field on the SQL Server.

See also FAQ section, FAQ#7995. You will find there a sample of how to change field type of table on disk from memo to general and vise versa using low-level file functions. You have to do it that way because there are no comfortable way in VFP to get content of general field into string or save it to file.

HTH.


>Dear all,
>
>I have an existing system which has a general field to let user to store their working image. I would like to move the system from VFP Database into N-tier using SQL Server. I would like to know how can I handle the image between Client and Server. How can I retrieve the image to display on the client? In VFP, I can use modify general to display the image. Thanks for your help and advice.
>
>Best Regards,
>
>Justy Chow
Vlad Grynchyshyn, Project Manager, MCP
vgryn@yahoo.com
ICQ #10709245
The professional level of programmer could be determined by level of stupidity of his/her bugs

It is not appropriate to say that question is "foolish". There could be only foolish answers. Everybody passed period of time when knows nothing about something.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform