storing path only to database...please help me...

L

leen

helo..i'm az...from kuala lumpur...i would like to ask a question about

access...i have doing a project based on access...i have done it
successfully but now the problem is size of the file...the limit for
access is only 2gb...but the file that i have to put in that database
is about 5gb..the type of file that i have to store is images(bitmap)
about 38000 images...before this,i store all the images to access...but

cannot store all the images because of the limitation...now...i want to

store only the path for the images only...and retrieve the images
later...so that it can reduce the size of the file...the question is
HOW can i do it???anyone can help me??this is the coding that i use to
load all the images to database...i hope this will help you give me
some idea...please help me..if you have any coding for this problem...i

hope you can share with me..

Option Compare Database


Private Sub cmdLoadOLE_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
[OLEFile].Class = [OLEClass]
[OLEFile].OLETypeAllowed = acOLinked
[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
 
G

Guest

When you get here: > MyFile = Dir(MyPath, vbNormal)
you now have the path to the file. Load that path into a table.

Set db = CurrentDb()
Set rs = db.OpenRecordset("tblPicturePath") 'Change this to your tables name.

With rs
.AddNew
!Path = MyFile 'The !Path is where you would put the actual field name.
.Update
End With

Set db = Nothing
Set rs = Nothing

End Sub
 
L

leen

Hello steven....

actually, i not really understand what u trying to tell...Is this code
for the path only??Does it get the image file together with the
path??It still take a big size for the database...as you know..I have
38000 files to load about 5GB...
plz help me.....

Regards
When you get here: > MyFile = Dir(MyPath, vbNormal)
you now have the path to the file. Load that path into a table.

Set db = CurrentDb()
Set rs = db.OpenRecordset("tblPicturePath") 'Change this to your tables name.

With rs
.AddNew
!Path = MyFile 'The !Path is where you would put the actual field name.
.Update
End With

Set db = Nothing
Set rs = Nothing

End Sub


leen said:
helo..i'm az...from kuala lumpur...i would like to ask a question about

access...i have doing a project based on access...i have done it
successfully but now the problem is size of the file...the limit for
access is only 2gb...but the file that i have to put in that database
is about 5gb..the type of file that i have to store is images(bitmap)
about 38000 images...before this,i store all the images to access...but

cannot store all the images because of the limitation...now...i want to

store only the path for the images only...and retrieve the images
later...so that it can reduce the size of the file...the question is
HOW can i do it???anyone can help me??this is the coding that i use to
load all the images to database...i hope this will help you give me
some idea...please help me..if you have any coding for this problem...i

hope you can share with me..

Option Compare Database


Private Sub cmdLoadOLE_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
[OLEFile].Class = [OLEClass]
[OLEFile].OLETypeAllowed = acOLinked
[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
 

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