Forums
This topic is locked
How do I do this:
Posted 09 Nov 2001 13:43:23
1
has voted
09 Nov 2001 13:43:23 Vivian Eersels posted:
In my DB I have a columm "ImageURL" and a colum "Photo"I want to do this:
I have an insertform that put the data in the DB,
but when there is no fileupload, I want that something automatic put in the
columm "Photo"
No picture insert: nophoto.gif
A picture insert: photo.gif
I hope you understand me, and you can help me
Vivian
Replies
Replied 10 Nov 2001 16:08:08
10 Nov 2001 16:08:08 Joel Martinez replied:
I think you should be able to put a default in your database for that field... then that way if the value is empty, it will put that value in there.
or you should be able to specify a default in the recordset dialog (at least I thought you could)
Joel Martinez [ ]
----------
E-Commerce Concepts with Ultradev...pre-order yours at
www.basic-ultradev.com/ecomm_concepts/
or you should be able to specify a default in the recordset dialog (at least I thought you could)
Joel Martinez [ ]
----------
E-Commerce Concepts with Ultradev...pre-order yours at
www.basic-ultradev.com/ecomm_concepts/
Replied 10 Nov 2001 18:34:59
10 Nov 2001 18:34:59 Vivian Eersels replied:
Ok, but that filed is not empty,
then must the right data put in that field and I tried that. It doesn't....
Vivian
then must the right data put in that field and I tried that. It doesn't....
Vivian
Replied 13 Nov 2001 17:01:09
13 Nov 2001 17:01:09 crazy larry replied:
couple ideas...
1. use the if-then command in the insert statement (i'm assuming DB has one) i would think it is sometime similiar to this:
(value1,insert this, value2,insert this)
2. have logic that tests the field values first before you insert the photo into DB...
more code/logic/time, but at least you know what is going on.
any way, that is my 2 cents
1. use the if-then command in the insert statement (i'm assuming DB has one) i would think it is sometime similiar to this:
(value1,insert this, value2,insert this)
2. have logic that tests the field values first before you insert the photo into DB...
more code/logic/time, but at least you know what is going on.
any way, that is my 2 cents
Replied 02 Dec 2001 15:50:21
02 Dec 2001 15:50:21 Steve Verschaeve replied:
Hello, I have the same problem and your ideas are nice but won't do it I'm afraid. the idea is not only to delete the record but the image as well. The default image is used in many records (that's what is for). When you delete the first record and the default image...the other records won't be deleted until the default image is removed. But it can't be removed because it's not there anymore, it was deleted the first time you removed a record. I don't know if it makes sence. So if there's someone out there that knows how to do it...I would be very thankfull!
Replied 02 Dec 2001 16:37:26
02 Dec 2001 16:37:26 jason parker replied:
I think one way to do this is to leave the db field empty and then do a check on your page for empty fields and use a variable to store the image location value:
Dim PicStore
if rsGuitaristDetail.Fields.Item("ImageURL".Value <> "" then
PicStore = rsGuitaristDetail.Fields.Item("ImageURL".Value
Else
PicStore = "/images/nopic.gif"
End if
Place this just after your recordset and repeat region code if you are using one!
Then to view your image use the following:
<img src="<%=PicStore%>" width="100">
Hope this helps <img src=../images/dmxzone/forum/icon_smile.gif border=0 align=middle>
Regards,
Jaysun
[ Web Chimp ]
------------------------
www.ultra-dumb.co.uk
<ook!>Brain food for web chimps</ook!>
------------------------
Edited by - jaysun on 02 Dec 2001 16:38:18
Dim PicStore
if rsGuitaristDetail.Fields.Item("ImageURL".Value <> "" then
PicStore = rsGuitaristDetail.Fields.Item("ImageURL".Value
Else
PicStore = "/images/nopic.gif"
End if
Place this just after your recordset and repeat region code if you are using one!
Then to view your image use the following:
<img src="<%=PicStore%>" width="100">
Hope this helps <img src=../images/dmxzone/forum/icon_smile.gif border=0 align=middle>
Regards,
Jaysun
[ Web Chimp ]
------------------------
www.ultra-dumb.co.uk
<ook!>Brain food for web chimps</ook!>
------------------------
Edited by - jaysun on 02 Dec 2001 16:38:18