473,813 Members | 3,529 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Image Database

6 New Member
I've been trying to create an image database using Access 2000 linked to all the images on our server, as per the instructions on the microsoft website.

The code to link the photos is as follows:

Private Sub Form_Current()
On Error Resume Next
If Not IsNull(Me![ImagePath]) Then
Me![Imageframe].OLETypeAllowed = 1
Me![Imageframe].SourceDoc = Me![ImagePath]
Me![Imageframe].Action = 0
End If
End Sub

Sub ImagePath_After Update()
On Error Resume Next
Me![Imageframe].OLETypeAllowed = 1
Me![Imageframe].SourceDoc = Me![ImagePath]
Me![Imageframe].Action = 0
End Sub

It then tells you to add to the properties of the 'unbound object frame'

Enabled = Yes<BR/>
Locked = No

I take it that <BR/> is By Row, so the image frame picks up the path on that row, and shows a different image per row.

The problem is that when the form/code is run all the images are referenced to the row that is clicked on/current, and when you use the properties box to try to change Yes to Yes<BR/> it won't allow the change and only allow Yes or No.

I've been trying to fix it for days can anyone help, it would be much appreciated.
Oct 5 '06 #1
4 3440
PEB
1,418 Recognized Expert Top Contributor
Hi

:)

In fact according your code and the unbound control object you will have ever time the current image!

I don't thinj that the problem is in <BR> I think this is a tog from Internet...

There it's sure you can't add it!

Coz it's property from type Boolean with only 2 values accepted : True or False

I suggest you to change the type of your Image as Bound Control and bound it to OLE Field in your database...

So all images will be linked in those controls! But your database will increase in size....

And the link will be enough slow 10 seconds per image! I do the same with Corel Draw! But not all images - only needed!

:)
Oct 8 '06 #2
ghowells
6 New Member
Thanks for all your help.

I managed to get the images to show correctly on a single form, but will only show one image on a continuous form, presumably because it only sees one record at a time as being current, by using this code:

Function setImagePath()
Dim strImagePath As String
On Error GoTo PictureNotAvail able
strImagePath = Me.txtImageName
Me.ImageFrame.P icture = strImagePath
Exit Function
PictureNotAvail able:
strImagePath = "C:\Windows\NoP icture.BMP"
Me.ImageFrame.P icture = strImagePath
End Function

then adding =setImagePath() to OnCurrent and AfterUpdate. this seems to work quite efficiently.

The idea is to be able to create a search of an image database and produce the results as a contact sheet.

I understand the problem would be the amount of images that the form could potentially generate would be too many for it to handle, but i could possibly limit the form to 10 records or maybe hide the form and go straight to a report.

Are there any ideas as to how i can get the continuous form to display many images based on the filepath saved in the corresponding record.

All your help is very much appreciated.
Jan 25 '07 #3
PEB
1,418 Recognized Expert Top Contributor
As u say this approach is good when u have single form! And u can apply it only in single form to visualize a picture!

If u want to visualize more than one picture in a form or in a report.... u need ur pictures to be in an OLE object that is bound!

I can imagine that u have all images as paths, so it isn't easy to import them!


so the only thing that i can help u is to show u the function that inserts into OLE bound control a number of wanted Corel Draw informations:

See how it is done:
I have a form and control on it:
FORM:Link_OLE
CONTROL:OLE1

Expand|Select|Wrap|Line Numbers
  1. Function link_Corel_from_liste(listes) As Integer
  2. On Error GoTo Err_link
  3. Dim draw As Object, draw1 As Object
  4. Dim mydb As Database
  5. Dim mys As Recordset
  6. Dim myr As Recordset
  7. Dim recs
  8. Dim currmys
  9. Dim p, mysr
  10. Dim xx As Long, yy As Long
  11. Dim i As Integer
  12. 'Stop
  13. Set mydb = CurrentDb()
  14. Set mys = mydb.OpenRecordset(listes) '"SELECT OAS.n°Cde AS Criteria, OAS.Pic_path AS SourceDoc, 'CorelDRAW 11.0 Graphic' AS Class, 0 AS OLETypeAllowed, '' AS SourceItem, 1 AS [Action], 3 AS SizeMode FROM OAS WHERE (((OAS.Pic_path) Like 'Y:\*')) ORDER BY OAS.n°Cde;"
  15. 'Set myr = Forms!Link_OLE.RecordsetClone
  16. If mys.RecordCount = 0 Then Exit Function
  17. mys.MoveLast
  18. mysr = mys.RecordCount
  19. currmys = 1
  20. mys.MoveFirst
  21. recs = Forms!Link_OLE.Recordset.RecordCount
  22. DoCmd.GoToRecord , "Link_OLE", acFirst
  23.  
  24. If fIsAppRunning("Corel") = False Then
  25.     Set draw1 = GetObject(mys("[Pic_path]"))
  26. End If
  27. Set draw = CreateObject("CorelDraw.Automation.11")
  28.  
  29. For p = 0 To recs - 1
  30. check_link1:
  31.     If mys("Criteria") = Forms!Link_OLE!Memo Then
  32.         draw.FileOpen mys("[Pic_path]")
  33.         draw.SelectAllObjects
  34.         'draw.Getsize xx, yy
  35.         'draw.SelectObjectsInRect -972111, 0, 2172111, 2044737, True
  36.         draw.CopyToClipboard
  37. 'Forms!Link_OLE!OLE1.Class = "CorelDRAW 11.0 Graphic"
  38.         Forms!Link_OLE!OLE1.Action = acOLEPaste
  39.         Forms!Link_OLE!OLE1.SizeMode = mys("SizeMode")
  40. '        Stop
  41. '        Debug.Print Forms!Link_OLE!OLE1.Height
  42. '        Debug.Print Forms!Link_OLE!OLE1.Width
  43. '        Forms!Link_OLE!OLE1.Height = Forms!Link_OLE!OLE1.Height * 3
  44. '        Forms!Link_OLE!OLE1.Width = Forms!Link_OLE!OLE1.Width * 3
  45.         draw.FileClose
  46.         If mysr > currmys Then
  47.             mys.MoveNext
  48.             currmys = currmys + 1
  49.         End If
  50.         DoCmd.GoToRecord , "Link_OLE", acNext
  51.         Debug.Print Now
  52.     Else
  53.         If mys("Criteria") > Forms!Link_OLE!Memo Then
  54.  
  55.         DoCmd.GoToRecord , "Link_OLE", acNext
  56.         Else
  57.             If mysr > currmys Then
  58.                 mys.MoveNext
  59.                 currmys = currmys + 1
  60.                 GoTo check_link1
  61.             End If
  62.         End If
  63.     End If
  64. Next p
  65. mys.Close
  66. mydb.Close
  67. Set draw = Nothing
  68. Set draw1 = Nothing
  69. Exit Function
  70.  
  71. Err_link:
  72. MsgBox ErrorString(Err.NUMBER)
  73. If Err.NUMBER = 2105 Then
  74.     Forms!Link_OLE.Undo
  75.     DoCmd.GoToRecord , "Link_OLE", acNext
  76. End If
  77. Resume Next
  78. End Function
  79.  
Good luck!

Thanks for all your help.

I managed to get the images to show correctly on a single form, but will only show one image on a continuous form, presumably because it only sees one record at a time as being current, by using this code:

Function setImagePath()
Dim strImagePath As String
On Error GoTo PictureNotAvail able
strImagePath = Me.txtImageName
Me.ImageFrame.P icture = strImagePath
Exit Function
PictureNotAvail able:
strImagePath = "C:\Windows\NoP icture.BMP"
Me.ImageFrame.P icture = strImagePath
End Function

then adding =setImagePath() to OnCurrent and AfterUpdate. this seems to work quite efficiently.

The idea is to be able to create a search of an image database and produce the results as a contact sheet.

I understand the problem would be the amount of images that the form could potentially generate would be too many for it to handle, but i could possibly limit the form to 10 records or maybe hide the form and go straight to a report.

Are there any ideas as to how i can get the continuous form to display many images based on the filepath saved in the corresponding record.

All your help is very much appreciated.
Jan 25 '07 #4
ghowells
6 New Member
Thankyou for all your help.

It may be a while before i can get to using it, restriction on my time at the moment. But i will let you know how it goes.
Jan 30 '07 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

2
2717
by: Ester | last post by:
Instead of drag and drop image button from Toolbox and name the image button id on the properties box, I would like to load image button ID from database. I created a database table that stores Image Button ID and Image (path name of the image for the image button). Example of the data will be: (ImgBtnLight, image\light.gif). The data type of the Image Button ID field in the database table is varchar whereas data type of image button in...
1
4414
by: John Scott | last post by:
I am storing an image in an SQL database and have one field as an image datatype. I am also using a webservice to transport data. I want to be able to resize the image and pass back a thumbnail image in a byte of what is in the database. I also want to be able to display this image in an <asp:image></asp:image> control. Is there any way to do this? Most of the examples that I've seen have used
6
3049
by: bissatch | last post by:
Hi, I am currently writing a news admin system. I would like to add the ability to add images to each article. What I have always done in the past is uploaded (using a form) the image to a folder on the server and then in the database table that I INSERT the news article, I'll store the path of the uploaded image. To me this seems a bad idea as if the image paths were changed on the
6
1920
by: Rudy | last post by:
Hello all! I am amazed how many posts I have read to store an image in SQL, and just as many against it. So I learned how to store an image in a SQL db and retrieve the image. A little tricky, but not too bad. But then I thought I wanted to try the other way, by putting the file location in SQL and storing the actual image in another directory. I plan to have many images on my web application, up to as many as 5000. Not to mention the...
13
2361
by: Neo Geshel | last post by:
I have examined about 80+ different upload scripts on the 'net, both in VB and C#, and none seem to do what I need them to do. Perhaps someone here can point me somewhere that Google hasn't reached yet (I have gone all the way to page 50 on Google's results!!). Here are my requirements: • I have a DataGrid. Everything will be done from here. Everything. No exceptions. Everything will also be done in VB, without any code-behind to...
35
2677
by: Stan Sainte-Rose | last post by:
Hi, What is the better way to save image into a database ? Just save the path into a field or save the image itself ? I have 20 000 images (~ 10/12 Ko per image ) to save. Stan
7
11647
by: lgbjr | last post by:
Hello All, I¡¯m using a context menu associated with some pictureboxes to provide copy/paste functionality. Copying the image to the clipboard was easy. But pasting an image from the clipboard is proving to be more difficult. These pictureboxes are bound to an AccessDB. If the user wants to add an image, they select an image using an OpenFileDialog: Dim result As DialogResult = Pic_Sel.ShowDialog() If (result = DialogResult.OK) Then
3
5250
by: den 2005 | last post by:
Hi everyone, Here is code working on..Trying to insert record with a column with Image or VarBinary datatype in sql database from a existing jpeg image file, then retrieve this image from database and display it in a Image web control dynamically(at runtime). The process after being displayed in the web control, user click insert/add button, it converts the image(jpeg) file to bytes and store it the database with Image or VarBinary...
7
5414
by: eholz1 | last post by:
Hello Group, Perhaps you can help me. I have a mysql db, that holds images. Images are encoded using base64_decode/encode, etc. Image data seems fine. I have a view.php page that is supposed to show the image, and an image.php page that accesses the database, retrives the image data, and then (theoretically) prints the decoded data to the page. below is the view.php page code: problem area the img tag src no
10
7454
by: Nathan Sokalski | last post by:
I am using ASP.NET 2.0, and need to know how to save and use an image that is stored in an SQL Server image datatype. How can I do this using ASP.NET? Thanks.
0
9607
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10667
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10407
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
10139
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
6897
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5568
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4358
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3885
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3030
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.