How to build an ODBC Connection

Anonymous
2023-07-13T21:47:21+00:00

Now that we have a folder with all of the images, How do I connect to it;

Use the query Wizard?

Where do I find the Data Connection Wizzard?

The name of my folder on the C: Drive is NEPhotos

Can I do it with a SQL statement

I have searched around for where and how to do it, but so far got nowhere.

Thanks Again Guys.

Old NASA Kid

Microsoft 365 and Office | Access | For business | Windows

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments
Answer accepted by question author
Duane Hookom 26,935 Reputation points Volunteer Moderator
2023-07-17T13:32:34+00:00

In all honesty we have never been made aware of project requirements, statement of purpose, scope, number of users, security, how the application needs to be updated and distributed, how data changes will be handled, etc. I have asked but never been answered. How can we get you somewhere when we really have no idea of where you are going. It's like we are in the back seat of a car offering directions without a clear understanding of our final destination. We know full well how to drive and shift and obey traffic laws and navigate but the drive often makes the same mistakes, doesn't seem to hear, plays the radio too loud and doesn't respond. Apparently the driver knows how to drive a tractor in a field but we are in a nearly self-driving car.

I have also suggested several times that based on your need for distributing this application across many locations with limited resources and who knows what age of computer, you should consider a web based application. This would allow for instant updates to all users worldwide, You could restrict access if needed. There would be absolutely no cost to any end user unless you wanted to charge a subscription. Images would be available to all users as long as they had a computer, tablet, or phone connected to the internet. No installing anything anywhere.

If you want to continue down the Access path, please consider creating one new thread with the information I suggested in the first sentence above. Also provide what you currently have which I believe is thousands of images.

Was this answer helpful?

1 person found this answer helpful.
0 comments No comments
Answer accepted by question author
Anonymous
2023-07-16T21:14:38+00:00

I re-vitalized an old form, with two jpg-files:

Image

For future use, you can even enlarge the pictures using the Zoom+ button:

Image

So, in principle it works, but only with a valid file-specification.

Imb.

Was this answer helpful?

1 person found this answer helpful.
0 comments No comments
Answer accepted by question author
Anonymous
2023-07-16T20:19:59+00:00

Me.Image25.Picture = strFile ?????????????

Hi T.Z.,

If strFile contains the full filespecification, including drive and filetype, it should work

Imb.

Was this answer helpful?

1 person found this answer helpful.
0 comments No comments

74 additional answers

Sort by: Most helpful
  1. Anonymous
    2023-07-25T23:53:30+00:00

    IMB;

    Thanks, but I messed up somewhere

    I have a form that uses a List Box to display the Images.

    I also Am trying to put a control in it. I have never used Controls before and in all honesty they confuse me.

    I put an Image Field on the form, with the two Cmd Boxes for zooming in and out, but they did not work.

    Here is my code:

                Dim rst As DAO.Recordset  
    
                Dim BldImg As Image  
                Dim RecNum As Byte  
                Dim PicImg As String  
                Dim HldPic As String  
                Dim ImagePath As String  
                  
                Dim imgWidth As Integer  
                Dim ImgHeight As Integer  
                  
                Set cdb = CurrentDb  
                  
                RecNum = ImgLst.Value  
                HldPic = ImgLst.Column(2)  
                PicImg = ImgLst.Column(1)  
                Me.Image25.Picture = HldPic  
                Me.Image25.SizeMode = acOLESizeZoom  
    
                Me.Image25.Picture = HldPic  
    

    Sub GetThePhoto(HldPic)

    Dim ctlImage As Control
    Set ctlImage = Me.Image25
    ctlImage.Picture = HldPic
    ctlImage.Width = ctlImage.Width

    End Sub

    Private Sub Zoom_plus_Click()

                Me.Image25\_ctl.Width = Me.Image25\_ctl.Width + 567    \*\*\*\* Error on this line    Method or data member not found   
    
                Me.Image25\_ctl.Heigth = Me.Image25\_ctl.Heigth + 567  
    

    End Sub

    Private Sub Zoom_ZSub_Click()

                Me.Image25\_ctl.Width = Me.Image25\_ctl.Width - 567    \*\*\*\* Error on this line    Method or data member not found  
                  
                Me.Image25\_ctl.Heigth = Me.Image25\_ctl.Heigth - 567  
    

    End Sub

    Thanks, I am learning some new things, still confused about what a control does.

    T. Z.

    Was this answer helpful?

    0 comments No comments
  2. Anonymous
    2023-07-25T21:39:10+00:00

    However the line below, that I have worked with for hours keeps giving me errors; So what am I doing wrong?

    Set rst = cdb.OpenRecordset("SELECT TOP 1 Location(BldImg), imageWidth FROM MstrPhts")

    Hi T.Z.,

    The ImageWidth is the number of horizontal pixels in the original photo. You cannot (and will not) change that. This is different from the width of the display of the photo in a control.

    How can you zoom the photo?

    Make a form with a "picture control", Photo1_ctl.

    Assign a picture to that control:

    Me.Photo1\_ctl.Picture = C:\NEPhotos\AnegBpos.jpg
    
    Me.Photo1\_ctl.SizeMode = acOLESizeZoom
    

    The constant acOLESizeZoom ensures that there is no distortion of the photo when the aspect ratio's of photo and control differ.

    Now make two buttons on the form: Zoom_plus and Zoom_min.

    In the Click-events of the buttons you use:

    Sub Zoom\_plus\_Click()
    
        Me.Photo1\_ctl.Width = Me.Photo1\_ctl.Width + 567
    
        Me.Photo1\_ctl.Heigth = Me.Photo1\_ctl.Heigth + 567
    
    End Sub
    

    The same for Zoom_min_Click, but use subtraction instead of addition.

    The dimensions of controls are expressed in "twips" with 1440 per inch, or 567 per cm. I prefer cm's over inches, but you can choose for any increment/decrement.

    Can you see the picture zooming in and zooming out?

    If this principle works, you are ready to let your phantasy do its work.

    Imb.

    Was this answer helpful?

    0 comments No comments