Advertisement

11.09.2005 at 11:09AM PST, ID: 21625251
[x]
Attachment Details

MS Access - embedded pictures

Asked by Stellar0645 in Microsoft Access Database

Tags: access, ms, picture

Hello:

My mission is to add images to each record in a database.  These images are unique for each record.  This is easy to do manually but for 2000+ records, manual is not an option.

I found some MS code from KB 198466, typed it in as given and of course it failed as is typical with Access.  The error is:

run time error 2777
The class argument in the CreateObject function of the Visual Basic procedure you're trying to run is invalid.  This really means what?  The OLE class is wrong?

The program is to find and embed images using the path, file extension and OLE Class entered into the form header.
The code follows, notes are on the right:

Private Sub cmd_LoadOLE_Click()

Dim MyFolder As String
Dim MyExt As String
Dim MyPath As String
Dim MyFile As String
Dim strCriteria As String

MyFolder = Me!SearchFolder
' get the search path
MyPath = MyFolder & "\" & "*." & [SearchExtension]
' get the first file in the path containing the file extension
MyFile = Dir(MyPath, vbNormal)
Do While Len(MyFile) <> 0
    [OLEPath] = MyFolder & "\" & MyFile
 '   [Date] = Date$                                                  this is my addition, fails.  Not declared above?
    [OLEFile].Class = [OLEClass]                               what are valid classes?  No help from MS on this, hopeless
    [OLEFile].OLETypeAllowed = acOLEEmbedded
    [OLEFile].SourceDoc = [OLEPath]
    [OLEFile].Action = acOLECreateEmbed                  error 2777 here, why?
    ' check for the next OLE file in the folder
    MyFile = Dir
    ' go to the next record on the form
    DoCmd.RunCommand acCmdRecordsGoToNew
Loop

End Sub

My database already has the filename and path.  Can't Access just use that to embed the image, or be told to?  This is what I would prefer.  There must be an article on this somewhere!

Thanks very much . . . . Springfield
Start Free Trial
[+][-]11.09.2005 at 11:12AM PST, ID: 15259035

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]11.09.2005 at 11:14AM PST, ID: 15259055

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]11.09.2005 at 11:15AM PST, ID: 15259067

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]11.09.2005 at 11:15AM PST, ID: 15259072

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]11.09.2005 at 11:22AM PST, ID: 15259137

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]11.09.2005 at 11:22AM PST, ID: 15259141

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]11.09.2005 at 11:38AM PST, ID: 15259299

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]11.09.2005 at 11:38AM PST, ID: 15259307

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]11.09.2005 at 02:40PM PST, ID: 15261349

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]11.09.2005 at 03:06PM PST, ID: 15261529

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]11.10.2005 at 11:53AM PST, ID: 15268617

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]11.10.2005 at 11:58AM PST, ID: 15268661

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]11.10.2005 at 12:09PM PST, ID: 15268764

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]11.11.2005 at 02:15PM PST, ID: 15277290

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]11.11.2005 at 03:00PM PST, ID: 15277520

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]11.13.2005 at 09:07AM PST, ID: 15283747

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]11.13.2005 at 09:16PM PST, ID: 15285849

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]11.14.2005 at 09:45AM PST, ID: 15289443

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]11.14.2005 at 01:54PM PST, ID: 15291387

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]11.14.2005 at 03:06PM PST, ID: 15291913

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zone: Microsoft Access Database
Tags: access, ms, picture
Sign Up Now!
Solution Provided By: kirenievs
Participating Experts: 5
Solution Grade: A
 
 
[+][-]11.15.2005 at 02:47PM PST, ID: 15299838

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]11.16.2005 at 03:35PM PST, ID: 15307845

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]11.16.2005 at 04:27PM PST, ID: 15308078

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]11.19.2005 at 04:43PM PST, ID: 15327680

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32