473,587 Members | 2,501 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

ASP Syntax Question??

Good day,

I'm very new to ASP and programming in general and I'm not sure if this is
the correct place for this question so I offer my apologies in advance.

I'm creating a press release page with Dreamweaver in ASP for a client. I've
created a small Access database to contain the information (Headline, Main
Story). I've also created 3 text fields (pic1, pic2, pic3) in the database to
store file pahtways to image files that the customer may like to include in
each new press release since Access cannot store images directly.

Dreamweaver generates an expression to write the contents of these fields,
text of course, into the HTML. To render the image I simply wrap the
dreamweaver expression in the IMG tag. Ex: <img src="<%DREAMWEA VER
EXPRESSION%>" /> and it works fine.

Now for the problem...

In most instances I would anticipate that only "pic1" field will contain
data and I have created two additional fields for the rare occassion when a
second or third image will be used. As such, I'd like to prevent the opening
and closing img tags from being written if the field they enclose contains no
data. To accomplish this I've done the following:

<%

Dim, pic1, pic2, pic3

pic1 = <%DREAMWEAVER EXPRESSION FOR PIC1 FIELD%>
pic2 = <%DREAMWEAVER EXPRESSION FOR PIC2 FIELD%>
pic3 = <%DREAMWEAVER EXPRESSION FOR PIC3 FIELD%>

If pic1 <> "null" Then
Response.Write ("<img src="pic1" />")

%>

As I said, I am very new to this sort of thing but as far as going by some
of the textbooks and other material I've read this look like a valid
expression to me.

However, testing on my local machine indicates internal server error. I'm
thinking that all the quotation marks are causing problems.

Is there something I'm overlooking regarding syntax? Bear in mind the
quotation marks around the file pathway/filename (pic1) are required.

Any help would be greatly appreciated.

Best regards,

Pat
Jul 22 '05 #1
1 1144
"Patty-O" <Pa****@discuss ions.microsoft. com> wrote

pic1 = <%DREAMWEAVER EXPRESSION FOR PIC1 FIELD%>
pic2 = <%DREAMWEAVER EXPRESSION FOR PIC2 FIELD%>
pic3 = <%DREAMWEAVER EXPRESSION FOR PIC3 FIELD%>

If pic1 <> "null" Then
Response.Write ("<img src="pic1" />")


Try
If not IsNull(pic1) then ...

Giles
Jul 22 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

699
33662
by: mike420 | last post by:
I think everyone who used Python will agree that its syntax is the best thing going for it. It is very readable and easy for everyone to learn. But, Python does not a have very good macro capabilities, unfortunately. I'd like to know if it may be possible to add a powerful macro system to Python, while keeping its amazing syntax, and if it...
4
2048
by: Aaron Walker | last post by:
Greetings, I'm attempting to write my first *real* template function that also deals with a map of strings to member function pointers that is making the syntax a little tricky to get right. The function in question: 36: template <typename Container, 37: typename OutputIterator,
2
1886
by: bor_kev | last post by:
Hi, First of all, i want to use the new managed class syntax and STL.NET under Microsoft Visual (C++) Studio 2005 Beta. I read in a Microsoft article(http://msdn.microsoft.com/VISUALC/default.aspx?pull=/library/en-us/dnvs05/html/stl-netprimer.asp) that i am suposed to include : #include <cli/vector> #include <algorithm>
5
4489
by: r.nikhilk | last post by:
Hi, Currently, we are porting C++ applications from 32 bit to 64 bit on AIX platform. (The current version of AIX is 5.3 and xlC verison is 8.0). We are able to compile the applications by including the -q64 option in xlC compiler. And we are able to link all these libraries to one of the main applications and generate an executable....
3
1496
by: astromog | last post by:
I have some significantly extended syntax for Python that I need to create a reference implementation for. My new syntax includes new keywords, statements and objects that are sort of like classes but not really. The implementation is all possible using standard Python, but the implementation isn't the point of what I'm doing. Speed and having...
11
5201
by: deppy_3 | last post by:
Hi! The syntax of fputs() is similar with the syntax of fgets(); For example if we have:fgets(str,maxlen,stdin) which is the syntax of the fputs();
8
3139
by: Smithers | last post by:
Are there any important differences between the following two ways to convert to a type?... where 'important differences' means something more profound than a simple syntax preference of the developer. x = someObject as MySpecificType; x = (MySpecificType) someObject; Thanks.
2
5203
by: berrylthird | last post by:
This question was inspired by scripting languages such as JavaScript. In JavaScript, I can access members of a class using array syntax as in the following example: var myInstance:myClass = new myClass(); myInstance.member_0 = memberValue_0; // absolute notation myInstance = memberValue_0; // relative notation myInstance = memberValue_0;...
17
3124
by: trose178 | last post by:
Good day all, I am working on a multi-select list box for a standard question checklist database and I am running into a syntax error in the code that I cannot seem to correct. I will also note that I am using Allen Browne's multi-select list box for a report as a guide. I should also note that my access skills are not the best so I may need...
6
2554
by: Daniel | last post by:
I hope this question is OK for this list. I've downloaded Rpyc and placed it in my site packages dir. On some machines it works fine, on others not so much. Here is one error I get when I try to import it: Traceback (most recent call last): File "<stdin>", line 1, in <module> File "C:\Python25\lib\site-packages\Rpyc\__init__.py", line...
0
7920
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
8347
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...
1
7973
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
8220
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...
0
6626
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
0
3844
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...
0
3879
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2358
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
0
1189
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...

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.