473,413 Members | 1,799 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,413 software developers and data experts.

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="<%DREAMWEAVER
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 1138
"Patty-O" <Pa****@discussions.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
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...
4
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. ...
2
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...
5
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...
3
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...
11
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
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...
2
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...
17
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...
6
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...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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...
0
Oralloy
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,...
0
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...
0
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,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
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...

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.