Inserting JPG images to an MSSQL 2000 table
Posted on 2005-04-06
Given an MSSQL server 2000 database, MYDATABASE that contains a table EMPPICS
whose fields are:
EMPPICSKEY INT (not null) (Primarykey)
EMPLOYEEKEY INT (not null)
PICTURE IMAGE (not null)
On my local harddrive, say at "c:\emppics\" , I have stored here employees images/pictures (JPG) whose filename corresponds to the actual employeekey found on EMPLOYEE table which resides on the same database mentioned above.
Sample JPG files are:
Can anybody suggest a delphi 6 function that will take the images/pictures path as parameter, read all JPG files on this directory and then insert/add these automatically to the EMPPICS table?
EMPPICS.EMPLOYEEKEY = JPGs filename
EMPPICS.PICTURE = the actual JPG image
So it will be something like:
EMPPICSKEY EMPLOYEEKEY PICTURE
1 1 (...)
2 15 (...)
3 21 (...)
4 30 (...)
If this can be done without using any 3rd party component at all, so much better.