Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Copy "Long binary Data"

Posted on 2008-10-23
6
Medium Priority
?
503 Views
Last Modified: 2008-10-25
I have a database where i store images (OLE OBJECT) and the field inside the table has the value "Long Binary Data".
I am trying to copy everything to another database and i would like to copy the field which stores the images as Long Binary Data.
Is there a way to do this ?

Thanks in advance
0
Comment
Question by:viroz
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
6 Comments
 
LVL 46

Expert Comment

by:tbsgadi
ID: 22783724
Hi viroz,

A regular copy or append query should work

Gary
0
 
LVL 1

Author Comment

by:viroz
ID: 22783748
No right click "Copy" available.
0
 
LVL 46

Assisted Solution

by:tbsgadi
tbsgadi earned 600 total points
ID: 22783945
If you're copying straight from the table then select the whole column (Copy is available)
0
Free Backup Tool for VMware and Hyper-V

Restore full virtual machine or individual guest files from 19 common file systems directly from the backup file. Schedule VM backups with PowerShell scripts. Set desired time, lean back and let the script to notify you via email upon completion.  

 
LVL 1

Author Comment

by:viroz
ID: 22784585
Ijust want to copy seperate fields. Is there a way to do this ?
0
 
LVL 46

Expert Comment

by:tbsgadi
ID: 22784831
Filter (on the ID) for the record you want & then select the column
0
 
LVL 58

Accepted Solution

by:
Jim Dettman (Microsoft MVP/ EE MVE) earned 1400 total points
ID: 22785143
You looking to do this manually or via code?  If code, then you want to use GetChunk() and AppendChunk().  I've attached a sample of code from the on-line help.

JimD.
Sub AppendChunkX()
 
	Dim dbsNorthwind As Database
	Dim rstEmployees As Recordset
	Dim rstEmployees2 As Recordset
 
	Set dbsNorthwind = OpenDatabase("Northwind.mdb")
 
	' Open two recordsets from the Employees table.
	Set rstEmployees = _
		dbsNorthwind.OpenRecordset("Employees", _
		dbOpenDynaset)
	Set rstEmployees2 = rstEmployees.Clone
 
	' Add a new record to the first Recordset and copy the 
	' data from a record in the second Recordset.
	With rstEmployees
 
.AddNew
		!FirstName = rstEmployees2!FirstName
		!LastName = rstEmployees2!LastName
		CopyLargeField rstEmployees2!Photo, !Photo
		.Update
 
		' Delete new record because this is a demonstration.
		.Bookmark = .LastModified
		.Delete
		.Close
	End With
 
	rstEmployees2.Close
	dbsNorthwind.Close
 
End Sub
 
Function CopyLargeField(fldSource As Field, _
	fldDestination As Field)
 
	' Set size of chunk in bytes.
	Const conChunkSize = 32768
 
Dim lngOffset As Long
	Dim lngTotalSize As Long
	Dim strChunk As String
 
	' Copy the photo from one Recordset to the other in 32K 
	' chunks until the entire field is copied.
	lngTotalSize = fldSource.FieldSize
	Do While lngOffset < lngTotalSize
		strChunk = fldSource.GetChunk(lngOffset, conChunkSize)
		fldDestination.AppendChunk strChunk
		lngOffset = lngOffset + conChunkSize
	Loop
 
End Function

Open in new window

0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

It’s the first day of March, the weather is starting to warm up and the excitement of the upcoming St. Patrick’s Day holiday can be felt throughout the world.
You need to know the location of the Office templates folder, so that when you create new templates, they are saved to that location, and thus are available for selection when creating new documents.  The steps to find the Templates folder path are …
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
In Microsoft Access, when working with VBA, learn some techniques for writing readable and easily maintained code.

722 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question