PDA

View Full Version : Virtual tables and VFP image files



SpringBox
2022-03-04, 10:19
Hi guys

The better integration of Lianja and VFP using virtual tables should be a godsend - no more web services...

In terms of HOWTO integrate Lianja and VFP with concurrent data access - can images now be inserted in to a VFP table?

thanks in advance


Springbox

HankFay
2022-03-04, 11:11
Hi,

Are you hitting Lianja tables or VFP Tables?

And if VFP tables, are you using the oledb driver?

In both cases, did you encounter any issue?

Hank

barrymavin
2022-03-04, 18:48
Hi SpringBox

What field type are you using in VFP to store images?

How are you currently storing the images in a VFP table and how are you extracting them?

How are you determining the image type?

Is this required in desktop only or web also?

SpringBox
2022-03-08, 11:26
Now tested and the basic oledb VT 2 way data sharing with VFP works really well - Thanks Barry.

Just a note though - it worked great with VFP free tables but it didn't like tables associated with VFP databases

Cannot find a VFP field type that will connect to VTs without an error. It would be great to have but VFP tables with any sort of associated file ie Memo fields etc are always really flaky.

So we plan to move the non-image data via VTs and the images we will regenerate as .jpg files in the form <customer_ID-imagenumber.jpg> as before and use a timer to poll the image database every 30 seconds or so for new images but it means we must have another app running the timer constantly.

Anyone think of a better approach?

Cheers


SpringBox

HankFay
2022-03-08, 12:23
Hi Spring,

Did you connect to the dbcx first when accessing a table in a dbc?

See https://www.connectionstrings.com/vfp-ole-db-provider/

Also, are you setting the VT properties includeblobs and includememos? https://www.lianja.com/doc/index.php/Virtual_Table_Properties If so, and you have a problem, perhaps this is a Lianja issue.

Hank

PS: having a code sample to replicate would be useful.

barrymavin
2022-03-08, 17:52
Hi Simon

In 7.1 I have made a lot of performance improvements with oledb as well as fixing up and working round various VFP oledb driver issues which I stumbled upon.

Memos are working well in both desktop and web, even in the data workspace. Full CRUD in the data workspace and sections is also working well in 7.1.

VFP varbinary fields are also handled by Lianja but the VFP oledb driver does not handle them consistently I.e it does not correctly return an image. What i have found is that it returns the name of the image stored in the varbinary field but that image is not to be found on the disk.

You can test this yourself in VFP outside of oledb.

open database northwind
use employees
copy memo photo to filename
type filename.txt

You will see:

EmpID1.bmp

NOTE - In VFP you're not allowed to read the varbinary or general field content. You can bind it to an olebound control and print it in a report via an olebound report control and that's it. This is not a Lianja issue.

This is why I asked you how are you storing images in VFP as Lianja has much better support for the storage and retrieval of images across desktop and web apps.