Forums

This topic is locked

Conditional Region extension problem

Posted 01 Aug 2001 08:27:43
1
has voted
01 Aug 2001 08:27:43 Eddie Pang posted:
I have this particular field where user can attached a file into the database (using ASPUpload).

In the view portion, I tried to provide a hyperlink to the field if there is a file that has been downloaded for the particular record so that user can download.

I tried using the Conditional Region extension to hide the hyperlink if there is no attached file for the record.

What I can was an error;
Error Type:
Microsoft VBScript runtime (0x800A000D)
Type mismatch

Can anyone please enlighten me ? Thanks!

Replies

Replied 01 Aug 2001 18:31:55
01 Aug 2001 18:31:55 Joel Martinez replied:
haha, I just replied to your first post telling you to use the conditional region... didn't read this one first.

hmm, post the details that you put into the extension, and also, post the code that the conditional region generated... then we can try to find something

Joel Martinez

----------
set rs = conn.execute("SELECT answer FROM brain WHERE question = "& forumPost &"
Replied 01 Aug 2001 23:18:28
01 Aug 2001 23:18:28 Waldo Smeets replied:
The most important things to know for us are: which one of the 6 Condition Region Server Behaviors did you use? I think that the DB Field and Script would be the best one in this case.

So as Joel also says: please tell us which code has been written to the page, and also which database you are using etc.

Waldo Smeets - www.UDzone.com Webmaster
<font size=1>-------------------------------------------
<i>Please read the Forum FAQ before posting
a question to this TalkZone.</i>
-------------------------------------------
www.UDzone.com : A dynamic Dreamweaver,
Ultradev and Fireworks site for developers
by developers.
-------------------------------------------</font id=size1>
Replied 02 Aug 2001 02:59:26
02 Aug 2001 02:59:26 Eddie Pang replied:
My code is:-

&lt;% If viewsupplier.Fields.Item("attachedfile".Value &lt;&gt; ("" Then 'script %&gt;
&lt;p&gt;&lt;%=(viewsupplier.Fields.Item("attachedfile".Value)%&gt;&lt;/font&gt;&lt;/p&gt;
&lt;% End If ' end If viewsupplier.Fields.Item("attachedfile".Value &lt;&gt; ("" script %&gt;

Hope this helps ! Thanks !



Edited by - Eddiep on 08/02/2001 03:02:20
Replied 02 Aug 2001 11:17:01
02 Aug 2001 11:17:01 Waldo Smeets replied:
You are not giving all the things I asked for:

- what database are you using?
- Is the image stored IN the database, or only the imagename and is the real image stored at the server?

Waldo Smeets - www.UDzone.com Webmaster
<font size=1>-------------------------------------------
<i>Please read the Forum FAQ before posting
a question to this TalkZone.</i>
-------------------------------------------
www.UDzone.com : A dynamic Dreamweaver,
Ultradev and Fireworks site for developers
by developers.
-------------------------------------------</font id=size1>
Replied 02 Aug 2001 11:46:33
02 Aug 2001 11:46:33 Eddie Pang replied:
Apologised for the insufficient info.

I am using a Microsoft Access 2000 database. The field to store the file is a OLE type. I am using ASPUpload to upload the file. The real file is actually stored in the server.

Any other information that you need ?

Thanks for helping.!!!!!!!!!!

Replied 02 Aug 2001 12:42:26
02 Aug 2001 12:42:26 Waldo Smeets replied:
My best advice is not to use an OLE object but to only put the name of the image (or complete link to the image) in the database. The conditional region extension does not work with OLE objects and to be honest: I have never used it so I do no tknow how to fix it at the moment.
There is an article on the MM Support site that explains in more detail how to link to images in your database: www.macromedia.com/support/ultradev/ts/documents/dyna_image.htm

After that you can use my conditional region to check for existance of a (name of) an image by using the DB Field and Script server behavior. Choose the region to show when there is an image, pply the behavior, choose the correct recordset and recordset filed, set Condition to &lt;&gt; (Not Equals) and type "" in the script box.

Waldo Smeets - www.UDzone.com Webmaster
<font size=1>-------------------------------------------
<i>Please read the Forum FAQ before posting
a question to this TalkZone.</i>
-------------------------------------------
www.UDzone.com : A dynamic Dreamweaver,
Ultradev and Fireworks site for developers
by developers.
-------------------------------------------</font id=size1>
Replied 02 Aug 2001 16:38:46
02 Aug 2001 16:38:46 Eddie Pang replied:
With your suggested method, how can a user perform an upload of file then ? Where will the file be kept then. Using ASPUpload allow the storing of file in a specified folder on the web server.

Your recommendation (I guess) seems to only apply if the administrators are the only one who upload the file into the web server.

Any other tutorial that you can suggest ?

Replied 02 Aug 2001 16:51:26
02 Aug 2001 16:51:26 Waldo Smeets replied:
No no.. everyone an upload the files with ASPUpload. You only have to be sure to save only the filename and not the complete image in your database. That's all.

Waldo Smeets - www.UDzone.com Webmaster
<font size=1>-------------------------------------------
<i>Please read the Forum FAQ before posting
a question to this TalkZone.</i>
-------------------------------------------
www.UDzone.com : A dynamic Dreamweaver,
Ultradev and Fireworks site for developers
by developers.
-------------------------------------------</font id=size1>
Replied 03 Aug 2001 07:59:03
03 Aug 2001 07:59:03 Eddie Pang replied:
Thanks Waldo ! Got it to work !

Reply to this topic