problem when load image files to database..

N

noorazlina85

i got a problem with database..when i trying to link the images from
1folder to database using vba coding i've got error 438"object doesnt
support this property or method"..actually i have to link 38000images
to the database....this is the code which i've try :

Option Compare Database
Option Explicit


Private Sub cmdLOAD_Click()


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


MyFolder = Me.SearchFolder ------------->i've got error 438 here!
' Get the search path.


MyPath = MyFolder & "\" & "*." & [Searchextension]------------->i've



got error 438 here!
' Get the first file in the path containing the file extension.
MyFile = Dir(MyPath, vbNormal)
Do While Len(MyFile) <> 0
[OLEPATH] = MyFolder & "\" & MyFile
[OLEFILE].Class = [OLEclass]
[OLEFILE].OLETypeAllowed = acOLELinked
[OLEFILE].SourceDoc = [OLEPATH]
[OLEFILE].Action = acOLECreateLink
' Check for next OLE file in the folder.
MyFile = Dir
' Go to new record on form.
DoCmd.RunCommand acCmdRecordsGoToNew
Loop


End Sub


can anyone help me..i'm blur.. if there are another solution..plz
inform me...ASAP..plz..
 
G

Guest

What is the contents of Me.SearchFolder, and is it a String field?

You've probably already seen the "HELP" documentation on err 438:

Not all objects support all properties and methods. This error has the
following cause and solution:

You specified a method or property that doesn't exist for this Automation
object.
See the object's documentation for more information on the object and check
the spellings of properties and methods.
You specified a Friend procedure to be called late bound.
The name of a Friend procedure must be known at compile time. It can't
appear in a late-bound call.
 
G

Guest

What I meant is, that I can reproduce this err 438 if SearchFolder field is
an OLE object, instead of a TEXT field.

Is this the problem?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top