AdoX and picture 
Author Message
 AdoX and picture

Hello.

I am trying to export data from a database using AdoX, which works fine, the
thing a need is now to add an picture to this sheet. Does anybody know how
to do that in AdoX ???

This is how i do it.
1. Get the data to export
2. Create an AdoX.Catalog object with the following connection:
    objConnection.Open "Provider=Microsoft.Jet.OLEDB.4.0;" & _
                "Data Source=" & strSavePath & strExcelDestinationFileName &
_
                ";Extended Properties=""Excel 8.0;HDR=YES;"""
3. Create the cells that a need using ADOX.Table
4. Inserting the data in the table
5. This creates an excel sheet.

Is there a way to add an image to the AdoX object?

Best regards

Mats Lindberg



Tue, 04 May 2004 19:41:33 GMT
 AdoX and picture

You may be able to do this if you create a column of type adLongVarBinary;
this can hold binary large objects such as images. You'll probably need to
use GetChunk and AppendChunk to move the data to your Excel recordset,
however.

See the following Knowledge Base article for more information:

Q296173: HOWTO: Use ADOX to Create OLE Object Field in an Access Database
http://support.microsoft.com/support/kb/Articles/q296/1/73.asp

That being said, I tested retrieving data containing an image into Excel;
the column was ignored. I don't believe Excel knows how to handle image
data as part of importing data.

Images in Excel workbooks are independent of cells; you may need to use
Excel automation (which of course will require that Excel be installed) to
import the image.

Hope this helps!

Steven Bras, MCSD
Microsoft Developer Support/Visual Basic WebData

This posting is provided "AS IS" with no warranties, and confers no rights.



Sat, 08 May 2004 04:14:44 GMT
 AdoX and picture
i will try, thanks for the tip
Mats


Quote:
> You may be able to do this if you create a column of type adLongVarBinary;
> this can hold binary large objects such as images. You'll probably need to
> use GetChunk and AppendChunk to move the data to your Excel recordset,
> however.

> See the following Knowledge Base article for more information:

> Q296173: HOWTO: Use ADOX to Create OLE Object Field in an Access Database
> http://support.microsoft.com/support/kb/Articles/q296/1/73.asp

> That being said, I tested retrieving data containing an image into Excel;
> the column was ignored. I don't believe Excel knows how to handle image
> data as part of importing data.

> Images in Excel workbooks are independent of cells; you may need to use
> Excel automation (which of course will require that Excel be installed) to
> import the image.

> Hope this helps!

> Steven Bras, MCSD
> Microsoft Developer Support/Visual Basic WebData

> This posting is provided "AS IS" with no warranties, and confers no
rights.



Tue, 11 May 2004 17:02:08 GMT
 
 [ 3 post ] 

 Relevant Pages 

1. ADOX.Indexes/ADOX.Key/Foreign Keys

2. Insert an Picture(Gif, Autocad Picture) to SQL Server

3. Invalid picture on bound picture box

4. VFP5 _screen = picture, can I get my picture centered

5. What is this ADOX? Can you create a Table using ADO or must you use ADOX?

6. Using ADOX

7. ADOX and Stored Procedure Problem

8. Create local SSCE database without ADOX

9. Create adTinyInt column with ADOX in SQLServer causes error

10. Create SQLServer DB from ADOX-VB6

11. ADOX Troubles

12. ADOX - Class not registered


 
Powered by phpBB® Forum Software