If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Upload Image
I would like users to be able to upload images to my database. Is there an
ActiveX control I should be using or better yet a tutorial I can take a look at? Thanks, Jason MacKenzie |
#2
|
|||
|
|||
Hi Jason,
You can display images, such as pictures, logos, and photographs, on your forms, reports, and data access pages (data access page: A Web page, published from Access, that has a connection to a database. In a data access page, you can view, add to, edit, and manipulate the data stored in the database. A page can also include data from other sources, such as Excel.). You can display static images, such as logos and banners that do not change from record to record, or display a different image for each record in the form or report. For example, the online Products Catalog might display the picture corresponding to the product that is currently being viewed. For more information on how to display images on forms, reports, and pages, see the following Office Online article: Dress up your Access database, at http://office.microsoft.com/assistan...HA010822771033. This article focuses on how and where to store the images so that you can display them on forms and reports. You can store images in one of the following ways: Store images in the database You store the images in an OLE Object field in a table. You can then add an image control on a form or report to display the contents of this field for each record. Note that this technique does not work for data access pages. Create an OLE object field in a table to store images Open the table in Design view. Add a field, and set the data type to OLE Object in an Access database, or to Image in an Access project. For more information on how to add a field to a table, see the Help topic Add a field to a table. In Datasheet view, right-click the OLE Object field in the row for which you want to add a picture, and click Insert Object. In the Microsoft Office Access dialog box, select Create New if the image file does not exist, or Create from File if the file already exists. Create New Select the Object Type, and click OK. Depending on the object type you chose, you will be able to create the image and save it as a file. Create from File Select the file that contains the image you want to store in the database, and click OK. Select the Link check box if you want to maintain a link to the file, instead of embedding the contents of the file in the database. Note Select Display as Icon to display an icon that represents the object type in Datasheet view. Note On a form, a bound frame control can be bound to an OLE object field, and you can add images through this control to the underlying field in Form view. For more information on how to add images to an OLE object field in Datasheet view or to a bound frame control that is bound to an OLE object field in Form view, see the section Add a picture or object that changes from record to record in the Help topic Add a picture or object. Store the paths to the image files in the database Instead of storing the pictures in the database, you could store just the path to the pictures. If you use this technique for a form or report, you need to write a Microsoft Visual Basic® for Applications (VBA) procedure to read the path information and display the pictures when the user opens the form or report. On a data access page, you add an image control and then bind it to a text field that contains the path to the pictures. Create a text field in a table to store paths to image files Create a field in a table and set the field's data type to Text in a Microsoft Access database (Microsoft Access database: A collection of data and objects (such as tables, queries, or forms) that is related to a particular topic or purpose. The Microsoft Jet database engine manages the data.) or varchar in a Microsoft Access project (Microsoft Access project: An Access file that connects to a Microsoft SQL Server database and is used to create client/server applications. A project file doesn't contain any data or data-definition-based objects such as tables and views.). In Datasheet view (Datasheet view: A window that displays data from a table, form, query, view, or stored procedure in a row-and-column format. In Datasheet view, you can edit fields, add and delete data, and search for data.), type the path to the image (a .bmp, .jpeg (JPEG: A graphics file format (.jpg extension in Microsoft Windows) supported by many Web browsers that was developed for compressing and storing photographic images. It's best used for graphics with many colors, such as scanned photos.), .gif (GIF: A graphics file format (.gif extension in Windows) used to display indexed-color graphics on the World Wide Web. It supports up to 256 colors and uses lossless compression, meaning that no image data is lost when the file is compressed.), .dib, .wmf, or .emf file) in the field you created. If you will be sharing the Access database, you might need to specify a UNC path (universal naming convention (UNC): A naming convention for files that provides a machine-independent means of locating the file. Rather than specifying a drive letter and path, a UNC name uses the syntax \\server\share\path\filename.). If you will be displaying the pictures on a data access page, you might need to specify a URL (Uniform Resource Locator (URL): An address that specifies a protocol (such as HTTP or FTP) and a location of an object, document, World Wide Web page, or other destination on the Internet or an intranet, for example: http://www.microsoft.com/.) to a valid Web address. Caution Users of your database or data access page will be able to view the image paths. You might want to make sure that the paths do not include personal information, such as your name or the name of your computer. Tip You can use relative paths to store pictures. For example, if the Access file (Microsoft Access file: An Access database or Access project file. An Access database stores database objects and data in an .mdb file. A project file doesn't contain data and is used to connect to a Microsoft SQL Server database.) is located at \\ServerName\ShareName\ and the pictures are stored in the folder \\ServerName\ShareName\Pictures, you don't have to specify the entire path, such as \\ServerName\ShareName\Pictures\PictureFileName.gi f, for a picture that you will display in a form or report. You only need to store the portion of the path that is different relative to the location of the current Access file— Pictures\PictureFileName. If you want to use relative paths to store the locations of pictures that you will display in data access pages, those paths must be relative to the location of the data access page, not the location of the Access database or Access project. For Further Information : http://office.microsoft.com/en-us/as...802251033.aspx Please let me know has this helped You... Thank you... Raghu... This posting is provided "AS IS" with no warranties, and confers no rights. |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Gripe about Word and image placement | Harlan Messinger | Page Layout | 31 | September 13th, 2004 04:16 PM |
How can I "upload" a pdf or image file to be saved into Access? | Petra | Running & Setting Up Queries | 2 | August 20th, 2004 03:03 AM |
Advanced MS Word Template Design Question: Image swap | postal_web | General Discussion | 11 | August 19th, 2004 03:32 PM |
Image on a Switchboard | John | General Discussion | 3 | July 27th, 2004 07:40 PM |
external image files on a report (continuation) | Veetold | Setting Up & Running Reports | 1 | May 21st, 2004 12:52 PM |