How to Store Images in a Database Subfolder to Prevent Broken Links in Microsoft Access

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
welcome to another techelp video brought to you by access learning zone.com I'm your instructor Richard Rost in today's video I'm going to show you how to store images in your database well not the actual images but the file name the path and file name but we're going to put it in a subfolder under your database folder in case that database folder moves in the future you won't have to deal with broken links let's talk about it today's question comes from Wesley in Plantation Flor one of my gold members Wesley says I'm following the example that you showed in your images video on how to store the full path and file name of an image in the table instead of storing the picture itself as an O object or an attachment and it works great I love it however my company just upgraded computers and the folder the database is in has moved now I got all these image locations that are pointing to the wrong place how can I fix this well Wesley will talk about fixing your specific situation a little bit later in the video but for now let me explain to everyone else what we've done and how to do it better okay the video that Wesley is talking about is this one it's my images video it's one of my more popular videos and in an nutshell I show you how you can store image data in your database you store the full path and the file name in a text field right you don't want to store the image itself in the database like in an attachment field or an O object field these things were okay in the past but they really make your database bloated and big and Microsoft Access databases were not designed to store binary data like this any kind of file attachments it's bad watch this video for a more in-depth description of why you don't want to do this stuff so what we do is we add a profile picture field in our customer table and then we stick the profile picture field on our form so we can type in where the the the the image is right the path and file name and then we put an image object on the form and then when you type in the images full name like that with the file name the image appears in the form okay and this is great if your images are always stored in C users Richard desktop images okay that's the problem Wesley is having is they recently upgraded and that folder location moved because he's storing it on a server the database folder is still up on the server but it's in a different path so the way we can resolve this is by simply making this a folder that's relative to the database folder so if the database folder moves then the images folder is going to move with it now in addition to this images video which you should go watch first before watching this video I want you to also go watch this video on concatenation it's putting two strings together okay these are both free videos they're on my website they're on my YouTube channel go watch those and come on back all right so here I am on my desktop but this could be anywhere this could be your database folder on a server on a different machine whatever I've got a DB folder that's where my database is going to be stored and under here I've got an images folder with some different images in it okay these these don't matter right now let's go back to the database folder so what we're going to do is we're going to put the pictures in my database but we're going to just tell it that the images folder is always under the current database folder okay how do we do that let's set it up real quick let's repeat what we did in the images video just real quick be a good review for you guys customer table design view come down to the bottom I'm going to add profile picture don't use picture or image or any of those simple reserved words right those are reserved words be careful all right this will be short text that's fine save it close it let's go into the customer form rightclick design just for the purposes of class we're going to get rid of the stuff we don't need let's get rid of all of this stuff and and let's bring in that field so form design add existing Fields profile pictures right down here let's drop it there close that I'm going to slide this over here all right profile picture right there make it fit it doesn't need to be as big as before because we're not going to have to put a full path in here all right let's drop the image here so don't use this one come into here and use this one all right and then click and drag where you want it it's going to ask you to browse to where you want it just hit cancel okay let's give this thing a name let's call it uh profile picture object whatever you want to call it doesn't matter all right now the important thing is setting its control source so the control source is going to be this profile picture but we're only going to have the file name in here the folder is going to be something we're going to specify right in the the control Source itself in here and here's what we're going to put I'm going to click here I'm going to hit shift F2 I'm going to zoom in okay now normally if you were going to have your images folder let's say in the in the the the database folder on your C drive right you could put in here equals and then in quotes C colon back slash database back slash images backs slash and then the file name which we can then concatenate with profile picture okay if this is a physical occasion you could use this for example if um if your images folder is not necessarily in the database folder you could put maybe you you're up on a file server here you could put Z or whatever the path to your database images folder is okay now if you want to use the images folder that's under your database folder we're going to replace this with current project. paath and then an ampersand all right current project. paath is the path the folder basically that your database is in so we're going to take that add images to it and then put the profile picture field at the end of that so now in the profile picture field all we have to store is just the file name now of course this is assumes that all of your images are in the same folder or if you want to put sub folders under this you could you could just have you know a SL whatever all right I'll hit okay and one more change I like to make when I'm working with this I like to go here go to the form properties and under other I'm going to make the tab cycle current record that way when I hit tab pass this it doesn't go to the next one it goes back to the first field of this record and it just stays on here that's one of my preferences okay all right save it close it let me open these up side by side so I can see what some of these file names are okay so let's go in here and for this one I'll put in JJ J.G and I'll hit tab boom there it is see that because the full path to that is determined in the control source for this control all right let's go to someone else here's James Kirk that is what is that test. jpeg tab there he is let's go back to me for a minute okay there we are these are animated gifts by the way um note to the access team Sammy add this to the list it would be nice if access could display animated gifts in forms right because he's supposed to be laughing here all right let's do another one uh let's do Captain peard I've got picard. gif there they are I love this one if you're not familiar with these this is the peard one I love these are hilarious here's the JJJ one I put this one on someone's post on like Facebook when they say something ridiculous and of course is kepi from Napoleon Dynamite this one isn't animated but oh well okay so you get the point right now the point here is if for some reason this folder moves it doesn't matter as long as this stays under the database folder you're good okay or or or if you want to specify your folder instead of using the current project. path you could put in here zon whatever and then if your folder does move all you have to do is change it in here you don't have to go through changing all these fields okay um one more thing if you want a button that you can click on right here to browse for that file so this thing pops up to this folder then you can click this and hit okay and then it puts that picture in there I Do cover that that is in the Extended Cut video for the original images video so go check that out you click a browse button little dialogue box pops up you stick that right in there now Wesley for your problem specifically in the Extended Cut I'm going to show you how to go through if you've got full paths in here right I'm going to show you how to go through and get rid of them so all you are left with is the file name and of course if all of your images are in one folder then you just point the image control to the new folder and then you'll have just the file in here we'll do that with a special update query that'll be in the Extended Cut for the members silver members and up get access to all of my Extended Cut videos and of course Wesley I know you and I have emailed back and forth so I know you're pretty cool and you're a Star Trek fan like I am and I have to do it at least once shut up [Music] Wesley all right that's GNA do it for today Wesley I know you appreciate my sense of humor but that's going to be your techel video I hope you you learn something live long and prosper my friends I'll see you next time and Wesley I'll see you in the Extended Cut if you enjoyed this video please give me a thumbs up and post any comments you may have below I do try to read and answer all of them as soon as I can make sure you subscribe to my channel which is completely free click the Bell icon and select all to receive notifications when new videos are posted want to learn more click the show more link below the video to find additional resources and links YouTube does a pretty good job of hiding it it's right down there see this part of the description here right the name the videos up here there's a little show more down there right down the bottom it's kind of hard to find but once you click on that you'll see a list of other videos additional information related to the current topic free lessons and lots more and YouTube no longer sends out email notifications when new videos are posted like they used to do but if you'd like to get an email every time I post an video click on the link to join my mailing list and you can pick how frequently to get emails from me either as they happen daily weekly or monthly now if you'd like to become a paid member of my channel and receive all kinds of awesome perks click on the join button you'll see a list of all the different membership levels that are available each with its own special perks including my Extended Cut videos access to my code Vault lots of VBA source code in there template downloads and lots more I'll talk more about these perks at the end of the video even if you don't want to commit to becoming a paid member and you'd like to help support my work please feel free to click on the tip jar link your patronage is greatly appreciated and will help keep these free videos coming I got some puppies to feed but don't worry no matter what these free techel videos are going to keep coming as long as you keep watching them I'll keep making more and they'll always be free now if you really want to learn access and you haven't tried my free access level one course check it out now it covers all the basics of Microsoft Access including building forms queries reports and more it's over 4 hours long you could find it on my website or on my YouTube channel I'll put a link down below you can click on and did I mention it's completely free the whole thing free 4 hours go watch it and okay okay a a lot of you have told me that you don't have time to sit through a 4-Hour course so I do now have a quicker Microsoft Access for beginners video that covers all the basics faster in about 30 minutes and no I didn't just put the video on fast forward but I'll put a link to this down below as well now if you like level one level two is just a dollar that's it $1 and that's another whole like 90minut course level two is also free for paid members of any level level including supporters so if you're a member go watch level two it's free okay want to get your question answered in a video just like this one visit my techel page and send me your question there members get priority of course while I do try to read and respond to all of the comments posted Below in the comment section I only have time to go through them briefly a couple of times a month and sometimes I get thousands of them so send me your question here on the techel page and you'll have a better chance of getting it answered and while you're on my website be sure to stop by my access Forum we've got lots of lively conversations about Microsoft Access and other topics I have a fantastic group of moderators who help me answer questions shout out to Alex Kevin Scott Adam John Dan Juan and everybody else who helps out on the site I appreciate everything you do I couldn't do it without you be sure to follow my blog find me on Twitter and of course on YouTube yeah I'm on Facebook too but I don't like Facebook don't get me started now let's talk more about those member perks if you do decide to join as a paid member there are different levels silver gold platinum and diamond silver members end up get access to all of my Extended Cut techel videos one free beginner class every month and some other perks Gold members get all the previous perks plus access to download the sample databases that I build in my techel videos plus access to my code Vault where I keep tons of different functions that I use the code that I build in most of the videos You'll also get higher priority if you do submit any Tech help questions now answers are never guaranteed but you do go higher in the list for me to read them and if I like your question you got a good chance of it being answered you'll also get one free expert level class each month after you finished the beginner series Platinum members get all the previous perks plus even higher priority for techel questions you get access to all of my full beginner level courses for every subject and I cover lots of different subjects like word excel VBA ASP lots of different stuff not just access these are the fulllength courses found on my website you get all the beginner ones in addition once you finish the expert classes you get one free developer class per month so lots of training and finally you can also become a diamond sponsor you'll have your name or your company name listed on a sponsor's page that will be shown on each video as long as you're a sponsor you'll get a shout out in the video and a link to your website or product in the text below the video and on my website so that's it once again my name is Richard Rost thank you for watching this video brought to you by access learning zone.com I hope you enjoyed I hope you learned something today live long and prosper my friends I'll see you again soon
Info
Channel: Computer Learning Zone
Views: 3,418
Rating: undefined out of 5
Keywords: TechHelp Access 2016, Access 2019, Access 2021, Access 365, Microsoft Access, MS Access, MS Access Tutorial, #msaccess, #microsoftaccess, #help, #howto, #tutorial, #learn, #lesson, #training, #database, relative image paths, database subfolder, shut up wesley, broken links fix, store file path Access, CurrentProject.Path, Access image control, concatenate file paths, dynamic image links Access, Access update query, manage external files Access
Id: Co_ddfmT09k
Channel Id: undefined
Length: 16min 32sec (992 seconds)
Published: Tue Feb 20 2024
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.