Copy link to clipboard
Copied
Hey all, ive just found this link http://forums.adobe.com/message/3556930 which is pretty much close to my problem. I am using DW CS4 and asp classic to pull data from my Access db using a Recordset.
I can see all the text except the image link (only comes up as a red cross in white square) on my browser. I am using a Localhost server ( IIS ) setup, so it should show.
What could be wrong? Here's the code:
<td width="13%" height="33" align="left" valign="top"><label><img src="<%=(Recordset.Fields.Item("Content Type").Value)%>"></label></td> <td width="16%" align="left" valign="top" class="main"><label> <input name="contact" type="text" class="p" id="contact" value="<%=(Recordset.Fields.Item("contact").Value)%>" readonly="readonly"> </label></td> <td width="15%" align="left" valign="top" class="main"><label> <input name="title" type="text" class="p" id="title" value="<%=(Recordset.Fields.Item("title").Value)%>" readonly="readonly"> </label> </td> <td width="32%" align="left" valign="top" class="main"><label> <textarea name="notes" cols="50" rows="2" readonly="readonly" class="p" id="notes"><%=(Recordset.Fields.Item("notes").Value)%></textarea> </label></td> <td width="15%" align="left" valign="top" class="main"><label class="p"> <input name="sale" type="text" class="p" id="sale" value="<%=(Recordset.Fields.Item("sale").Value)%>" size="20" readonly="readonly"> </label> </td> <td width="9%" align="left" valign="top" class="main"><label> <input name="date" type="text" class="p" id="date" value="<%=(Recordset.Fields.Item("dbdate").Value)%>" size="12" readonly="readonly"> </label></td> </tr>
In my Access Table the image is store as a "OLE Object" if it helps.
Thx in advance
Copy link to clipboard
Copied
>I can see all the text except the image link
I don't see any links at all in that code.
First, it's not clear which, if any, of the items in that code are the actual image. Is it in there? DW will not create a field in the recordset for binary items - because you can not simpy use the value property to display them. It takes much more code.
Second, storing images in binary fields has largely been discontinued over the last 5-10 years because of performance problems. Couple that with the fact you are using Access and I guarantee this application would not scale well on the internet. The common way these days is to use a file system repository. That is, store the images (or other binary file) in the file system and store the path to the file (and other meta data) in the database.
Copy link to clipboard
Copied
Bregent, I share the same concerns as you. Although they did state it will be for intranet, I'd be just as worried about availability as scalability. From what I'm reading it appears Access it being used as a CRM suite (I see contact, title, notes and sale fields).
It's that information that makes me question these posts as to why the wheel needs to be re-invented. There are plenty of viable solutions from web-based like Salesforce and Microsoft BPOS to client applications like ACT and GoldMine or a self-hosted solution like SugarCRM. With any of those you should be able to easily attach images, PDFs or any file type and keep all data in sync without having to manage an Access database. Plus with those solutions you don't run into the limitations of Access ( http://office.microsoft.com/en-us/access-help/access-2010-specifications-HA010341462.aspx ). Eliminate all the development cost and just worry about the maintenance cost.
Copy link to clipboard
Copied
Hey guys thx for the replies. Im not a very good coder, so as i develop the Intranet at my company, im learning. I will research what you guys suggested.
I read through the following tutuorial http://www.stardeveloper.com/articles/display.html?article=2001033101&page=1 on how to get a user to input their details, images included, and then view the information on another page, which works if one follows his format. I tweaked it a bit and well ran into this error by using DW's recordset structure instead hardcoding like he did.
So if you can maybe direct me to any good tutorials on how to do this using today's methods, that will be great. Otherwise i just though a simple fix of line 56 should do it but clearly not.
Copy link to clipboard
Copied
Oh one more thing, with the solutions mentioned by SnakeEyez02, will i be able to capture the users input data in a database and display it later? What im trying to achieve is build a for sale page like ( www.gumtree.com). A advertisement page where the people in our company can advertise their personal stuff ( on the Intranet) they want to sell.
Copy link to clipboard
Copied
Ok I think I misunderstood a little bit of what you were looking for. There are classified script solutions available (check out www.hotscripts.com ), or if your company intranet uses Sharepoint you could probably modify a custom list. If you don't have the infrastructure the Microsoft BPOS services offer Sharepoint as a service that you can control. Personally for intranets I would recommend the Sharepoint server with Sharepoint designer over DW just because you don't have to worry about setting up a login system since it uses the network login and it does a lot of the behind the scenes maintenance that you shouldn't have to worry about. The cost is based per user and it is usually between $5-10/month for the hosted solution. Unfortunately I don't have any figures for the actual server software itself.
It's just something to consider. If not basically what you would be looking to do (and keep in mind I typically code in PHP so if something looks weird it might be) is pull the image path as bregent suggested and then in your code your image would be like:
<img src="/{img_path}/<%=(Recordset.Fields.Item("img_name").Value)%>">
You would have to write the script to upload the file to a specific path and then the path is hard coded into the script and you pull out the name of the image. So it's along the lines of what you have now except that you will store the image name instead of the object and upload the file to the website folder upon form submission.
Copy link to clipboard
Copied
Hey SnakEyez02, you are right on the button of what i am trying to do. I have this link http://www.stardeveloper.com/articles/display.html?article=2003040501&page=1 which is basically what you are telling me to do. It's just that if i follow the writer of the tutorial's instructions then i can view the images' displayed as a link in my browser, see screen shot pls.
Like i said this is only for our Intranet so the company will not spend money on buying software applications to do something which is working by following above tutorial. Let me try your solution and see if it works. Thx
Copy link to clipboard
Copied
Unfortunately your suggestion brings up this error, you did say you are more at home with php. I will investigate some more in regards to the error.
ADODB.Fields (0x800A0CC1)
Item cannot be found in the collection corresponding to the requested name or ordinal.
/SAMIntranet/showx.asp, line 59
Copy link to clipboard
Copied
We would need to see the code to resolve any issues.
Copy link to clipboard
Copied
OK here it is:
<%@LANGUAGE="VBSCRIPT"%>
<!--#include file="Connections/Smit.asp" -->
<%
Dim Recordset
Dim Recordset_cmd
Dim Recordset_numRows
Set NOCOUNT = ON
Set Recordset_cmd = Server.CreateObject ("ADODB.Command")
Recordset_cmd.ActiveConnection = MM_Smit_STRING
Recordset_cmd.CommandText = "SELECT * FROM files"
Recordset_cmd.Prepared = true
Set Recordset = Recordset_cmd.Execute
Recordset_numRows = 0
%>
<%
Dim Repeat1__numRows
Dim Repeat1__index
Repeat1__numRows = -1
Repeat1__index = 0
Recordset_numRows = Recordset_numRows + Repeat1__numRows
%>
and
<table width="100%" border="0" cellspacing="1" cellpadding="3"> <tr> <td width="13%" height="33" align="left" valign="top"><label><img src="/{img_path}/<%=(Recordset.Fields.Item("img_name").Value)%>"></label></td> <td width="16%" align="left" valign="top" class="main"><label> <input name="contact" type="text" class="p" id="contact" value="<%=(Recordset.Fields.Item("contact").Value)%>" readonly="readonly"> </label></td> <td width="15%" align="left" valign="top" class="main"><label> <input name="title" type="text" class="p" id="title" value="<%=(Recordset.Fields.Item("title").Value)%>" readonly="readonly"> </label> </td> <td width="32%" align="left" valign="top" class="main"><label> <textarea name="notes" cols="50" rows="2" readonly="readonly" class="p" id="notes"><%=(Recordset.Fields.Item("notes").Value)%></textarea> </label></td> <td width="15%" align="left" valign="top" class="main"><label class="p"> <input name="sale" type="text" class="p" id="sale" value="<%=(Recordset.Fields.Item("sale").Value)%>" size="20" readonly="readonly"> </label> </td> <td width="9%" align="left" valign="top" class="main"><label> <input name="date" type="text" class="p" id="date" value="<%=(Recordset.Fields.Item("dbdate").Value)%>" size="12" readonly="readonly"> </label></td> </tr> </table>
I take it the " src="/{img_path}/" part is where i should put in the path to the newly linked images. Probablem is i do not know where its linked to seeing as it is kept in the Access db. I think
Copy link to clipboard
Copied
>ADODB.Fields (0x800A0CC1)
>Item cannot be found in the collection corresponding to the requested name or ordinal.
>/SAMIntranet/showx.asp, line 59
This tells me you are trying to reference an item that is not in your select list. It's possibly due to a typo in your code, or you are trying to access the binary image using the value attribute - which as I mentioned earlier is not possible. You still have not answered the question about which if any of those fields in your code is the image field. It's also not clear which line the error is occuring on, because you have not posted the code in its original format. If we don't know which line is 59, we can only guess.
It's also not clear why you are using form fields, but no form.
If you insist on storing the image in the database - which I would highly discourage - then you need to use completely different code if you want to display the image. Look here for details: http://www.codeproject.com/KB/asp/Display_Images_from_Data.aspx
Copy link to clipboard
Copied
Hi Bregent, all i know is that it is working by usning the tutorial i mentioned in a previous post. Here's the page that is working. This is doing excately what i need. I just thought i'll try to simulate this in Dreamweaver CS4, but seeing as i cannot find the answer, i think i'll just stick to the version that is working. In saying that
When you click on any of the red links (Swop/for sale/tewst) then it opens the image. I am not trying to reinvent the wheel. I am perfectly happy with this method, just battling to be able to manipulate the table into the format i want it to be, but cannot do this. That is why i went the other route and re created the above page in DW CS4 and ended up asking you guys why Line 59 as supplied by SnakeEyz02 previously which was this <img src="/{img_path}/<%=(Recordset.Fields.Item("img_name").Value)%>"> , is giving me the following error?
ADODB.Fields (0x800A0CC1)
Item cannot be found in the collection corresponding to the requested name or ordinal.
/SAMIntranet/showx.asp, line 59
In all due respect Bregent, the code you have asked for i posted previously. If you are not reading what i am asking then don't answer. Has coding become a product of copy and paste and download some app to do it all for you, rather than figuring it out? I would like to know how the tutorial i used can work for me, and how i can incorporate that into my method.
Thank you
Copy link to clipboard
Copied
>That is why i went the other route and re created the above
>page in DW CS4 and ended up asking you guys why Line 59
>as supplied by SnakeEyz02 previously which was this
><img src="/{img_path}/<%=(Recordset.Fields.Item("img_name").Value)%>"> ,
>is giving me the following error?
Ah. SnakeEyz just gave you an example of what the code would look like if you used an image path. But you are not using an image path - you are storing the image in the database. So "Recordset.Fields.Item("img_name").Value" is not a valid item in your database, hence the error.
>If you are not reading what i am asking then don't answer.
I've read every post in this thread and sorry if I misunderstood anything. You don't need to be rude - we are only trying to help.
>Has coding become a product of copy and
>paste and download some app to do it all for you, rather than figuring it out?
Not sure what you are implying. Please clarify.
>I would like to know how the tutorial i used can work for me,
>and how i can incorporate that into my method.
If you want to display the images inline, rather than links, then read the tutorial I posted.
Copy link to clipboard
Copied
Apologies for sounding rude, not my intention. I am frustrated however with the coding thing. Ive asked many questions on many forums on different coding venture and well rarely did i get an answer that solved my queries. But for you help i am MUCH appreciated. I will follow up on your tutorial.
Now what i meant with my " has coding become a product of..." - Back a good few years when i worked in a small team where we developed Touch screen technologies and Web sites, the Web master use to write his own code from scratch. Nowadays i have noticed it seems as if applications and software do most of the coding for a person, and you do not need to repair the wheel, if you will, but rather buy a new one.
SO thx for your help, i will look at your tutorial and see what i can make of it and how to incorporate it into my INtranet.
THx again.
Copy link to clipboard
Copied
If I can add my opinion, I think you are completely mistaken. My ratio of hand coding to machine coding is quite high. But I do let DW write the simple stuff or the tedious stuff.
Copy link to clipboard
Copied
>i will look at your tutorial and see what i
>can make of it and how to incorporate it into my INtranet.
Let us know if you get stuck anywhere.
>Nowadays i have noticed it seems as if applications
>and software do most of the coding for a person
Well, or couse DW has server behaviours which do generate code. But I don't use them and have not for years. The biggest problem with them is they only get you to 70% of where you need to go, and you then need to hand code anyway. Once you manually add code, it breaks the behavior widget. I also find the server behavior code to be overly complicated, as it needs to fit into many different scenarios. So I just code server side scripting 100% by hand.
Copy link to clipboard
Copied
Well it's good to hear that hand coding (hard coding) is still being done. As i have said, i have noticed on alot of forums when i ask for help, I allmost 95% of the time get the same answer. "use php and asp.net" or "why are you using DW and not MS Visual studio" etc... and then "use this application (that you have to buy), it will do what you need".
Looking at the tutorial, i used right in the beginning, by following the tut, it did what i wanted but in a lob side way. As you said bregent, "it breaks the behavior widget".
Thx for everyone's help. I will post here if i need some more advice.