I'm Lost

Sato

Registered User.
Local time
Today, 14:26
Joined
Feb 27, 2003
Messages
14
Hi,
I have a database where each record is a car details.
I want to know if it's possible to put several pictures of the car and also an Excel file with information in that database.
For example i have a record with information of the car like (colour, year, nº doors...) and i want to create a way in wich, apart from this information i can have some photos and also a file with other data from the car.
How do i put the photos (linked to a folder in windows?)
How do i put the file (linked to a folder in windows?)
How do i create a folder in windows (named like the license plate number, for example) where the photos and files should be kept?
I don't know if this is possible or perceptible.

Thanks,
Sato
 
Try doing a search on pictures on the forum - there are a couple of links that folk give that will give you a real good start with this problem.

Keeping pictures stored in the database will potentially make it huge. But the links mentioed above mean you can show the picture for each record without storing it in the dbase. I am fairly new to Access and even I managed to sort it!

With regards to the Excel data, I would have throught bringing in all the data from Excel into Access would be the best best. Why keep some data in Excel and some in Access?

good luck.
 
Hope this helps

You can use or modify this to your needs.. We use this in one of our apps, it basically will take an image and copy based on an Autonumber Primary Key to a subdirectory. It pulls the image type (extension), and assigns the name based on this PK.

You can clean out the fat you don't need ( I use a Common Dialog Box, etc. and CurrentDBDir(), which you can just manually assign the directory, etc.)

Private Sub cmdGetImage_Click()
On Error GoTo ContinueError

Dim varFileName As String
Dim varDestination As String
Dim varImageName As String
Dim varExtension As String

cdlOpen.Filter = "Bitmaps (*.bmp)|" & "*.bmp|" & "Jpegs (*.jpg)|" & "*.jpg|" & "PC Paintbrush (*.pcx)|" & "*.pcx|" & "Tiffs (*.tif)|" & "*.tif|" & "Windows Metafile (*.wmf)|" & "*.wmf"
cdlOpen.ShowOpen

cdlOpen.cancelerror = True
varFileName = cdlOpen.FileName


varExtension = ReverseString(RemoveExtension(ReverseString(varFileName))) 'Get extension
varImageName = Me.ImageControl & "." & varExtension 'Rename image to Primary Key and extension
Me.ImageFileName = varImageName

varDestination = CurrentDBDir & "image\" & varImageName

FileCopy varFileName, varDestination

Me.txtPath = varDestination
Me.imgScreen.Picture = Me.txtPath

MsgBox "Image Transfer Complete", vbOKOnly, "Complete"

Me.ImageName.Enabled = True
Me.ImageDescription.Enabled = True
Me.ImageName.SetFocus

ExitError:
Exit Sub

ContinueError:
If Err.Number = 32755 Or Err.Number = 5 Then
Call DeleteImageAquired(Me.txtPath)
ElseIf Err.Number = 2114 Then
Call DeleteImageAquired(Me.txtPath)
MsgBox "An Image Decoder was not Found, Cannot Aquire Image", vbCritical, "No Decoder"
Else
Call DeleteImageAquired(Me.txtPath)
MsgBox "Error Aquiring Image", , "Image Error"
End If
Resume ExitError

End Sub
 

Users who are viewing this thread

Back
Top Bottom