How To programmatically add and retrieve documents using OLE Objects

  • Thread starter Thread starter Londoner101
  • Start date Start date
L

Londoner101

Hi all.

I have an Access database with linked tables to SQL Server 2005. I
have a table with a field defined as a VarBinary which is to be used
to store documents (word, excel etc)

Does anyone have sample VBA code to (1) insert or update the document
to the linked table (2) retrieve the data and write to the file
system.

I have done this via .NET successfully but need to do it via VBA and
am struggling to do this as my VBA experience is rusty to say the
least.

All help and direction greatly appreciated.

Thanks

Raj
 
Hi all.

I have an Access database with linked tables to SQL Server 2005. I
have a table with a field defined as a VarBinary which is to be used
to store documents (word, excel etc)

Does anyone have sample VBA code to (1) insert or update the document
to the linked table (2) retrieve the data and write to the file
system.

I have done this via .NET successfully but need to do it via VBA and
am struggling to do this as my VBA experience is rusty to say the
least.

All help and direction greatly appreciated.

Thanks

Raj

For those interested This link provides sample code I was looking for

http://support.microsoft.com/kb/210486

However note, although this worked if the table was defined in Access,
I couldn't get this working for linked SQL Seerver tables. I always
get a ODBC - Failed to update linked table exception when the Update
method of the recordset is called.


...still looking for a resolution to this!
 
Hi all.

I have an Access database with linked tables to SQL Server 2005. I
have a table with a field defined as a VarBinary which is to be used
to store documents (word, excel etc)

Does anyone have sample VBA code to (1) insert or update the document
to the linked table (2) retrieve the data and write to the file
system.

I have done this via .NET successfully but need to do it via VBA and
am struggling to do this as my VBA experience is rusty to say the
least.

All help and direction greatly appreciated.

Thanks

Raj

I found this link which seems to do the trick

http://archives.postgresql.org/pgsql-odbc/2001-10/msg00066.php
 
Back
Top