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.
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!
:)
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.
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 -
Function link_Corel_from_liste(listes) As Integer
-
On Error GoTo Err_link
-
Dim draw As Object, draw1 As Object
-
Dim mydb As Database
-
Dim mys As Recordset
-
Dim myr As Recordset
-
Dim recs
-
Dim currmys
-
Dim p, mysr
-
Dim xx As Long, yy As Long
-
Dim i As Integer
-
'Stop
-
Set mydb = CurrentDb()
-
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;"
-
'Set myr = Forms!Link_OLE.RecordsetClone
-
If mys.RecordCount = 0 Then Exit Function
-
mys.MoveLast
-
mysr = mys.RecordCount
-
currmys = 1
-
mys.MoveFirst
-
recs = Forms!Link_OLE.Recordset.RecordCount
-
DoCmd.GoToRecord , "Link_OLE", acFirst
-
-
If fIsAppRunning("Corel") = False Then
-
Set draw1 = GetObject(mys("[Pic_path]"))
-
End If
-
Set draw = CreateObject("CorelDraw.Automation.11")
-
-
For p = 0 To recs - 1
-
check_link1:
-
If mys("Criteria") = Forms!Link_OLE!Memo Then
-
draw.FileOpen mys("[Pic_path]")
-
draw.SelectAllObjects
-
'draw.Getsize xx, yy
-
'draw.SelectObjectsInRect -972111, 0, 2172111, 2044737, True
-
draw.CopyToClipboard
-
'Forms!Link_OLE!OLE1.Class = "CorelDRAW 11.0 Graphic"
-
Forms!Link_OLE!OLE1.Action = acOLEPaste
-
Forms!Link_OLE!OLE1.SizeMode = mys("SizeMode")
-
' Stop
-
' Debug.Print Forms!Link_OLE!OLE1.Height
-
' Debug.Print Forms!Link_OLE!OLE1.Width
-
' Forms!Link_OLE!OLE1.Height = Forms!Link_OLE!OLE1.Height * 3
-
' Forms!Link_OLE!OLE1.Width = Forms!Link_OLE!OLE1.Width * 3
-
draw.FileClose
-
If mysr > currmys Then
-
mys.MoveNext
-
currmys = currmys + 1
-
End If
-
DoCmd.GoToRecord , "Link_OLE", acNext
-
Debug.Print Now
-
Else
-
If mys("Criteria") > Forms!Link_OLE!Memo Then
-
-
DoCmd.GoToRecord , "Link_OLE", acNext
-
Else
-
If mysr > currmys Then
-
mys.MoveNext
-
currmys = currmys + 1
-
GoTo check_link1
-
End If
-
End If
-
End If
-
Next p
-
mys.Close
-
mydb.Close
-
Set draw = Nothing
-
Set draw1 = Nothing
-
Exit Function
-
-
Err_link:
-
MsgBox ErrorString(Err.NUMBER)
-
If Err.NUMBER = 2105 Then
-
Forms!Link_OLE.Undo
-
DoCmd.GoToRecord , "Link_OLE", acNext
-
End If
-
Resume Next
-
End Function
-
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.
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.
Sign in to post your reply or Sign up for a free account.
Similar topics |
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...
|
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
|
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
|
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...
|
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...
| |
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
|
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
|
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...
|
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
|
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.
|
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,...
| |
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...
|
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...
|
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...
|
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();...
|
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...
|
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
| |
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
|
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...
| |