Solved

Copy "Long binary Data"

Posted on 2008-10-23
6
445 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
  • 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 150 total points
ID: 22783945
If you're copying straight from the table then select the whole column (Copy is available)
0
Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

 
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 57

Accepted Solution

by:
Jim Dettman (Microsoft MVP/ EE MVE) earned 350 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

Backup Your Microsoft Windows Server®

Backup all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

Join & Write a Comment

Most if not all databases provide tools to filter data; even simple mail-merge programs might offer basic filtering capabilities. This is so important that, although Access has many built-in features to help the user in this task, developers often n…
Introduction The Visual Basic for Applications (VBA) language is at the heart of every application that you write. It is your key to taking Access beyond the world of wizards into a world where anything is possible. This article introduces you to…
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

706 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now