---
title: "If satser och else??"
type: "forum-thread"
url: "https://www.webforum.nu/amne/asp/71524-if-satser-och-else"
topic: "ASP"
topic_url: "https://www.webforum.nu/amne/asp"
author: "BoLana"
published: "2003-03-18T23:31:34.000Z"
updated: "2003-03-19T13:54:46.000Z"
replies: 6
views: 233
page: 1
pages: 1
language: "sv-SE"
site: "webForum — webforum.nu"
rights: "Upphovsrätten till varje inlägg tillhör dess författare."
attribution: "Citera som: webForum, https://www.webforum.nu/amne/asp/71524-if-satser-och-else"
---

# If satser och else??

## #1 — BoLana, 2003-03-18T23:31Z

Denna ska skriva ut ur databasen infot under kolumnen bilder. och om det står default.gif på den rad ska den skippa det och ta nästa rad. Behöver hjälp med denna, är inte ngt vidare på asp med håller på lär mig. Ngn som kan förklara kanske? //Robban

\<%
X = 0
DO Until RecSet.EOF OR X = 4
X=X+1
%\>

\<%
if RecSet("bild") = "" then
Response.Write ""
else
Response.Write "\<img src='"& RecSet("bild") &"' width='80' height='100' title='"& RecSet("username") &"' border='0'\>"
end if
%\>

\<%
RecSet.MoveNext
Loop

RecSet.Close
Connect.Close
Set RecSet = nothing
Set Connect = nothing
%\>

Permalänk: https://www.webforum.nu/p/71524

## #2 — Jesper T, 2003-03-18T23:43Z

**Välkommen till WF!**
Fattar inte riktigt vad du menar, nåt sådant kanske?:

```
<%
X = 0
DO Until RecSet.EOF OR X = 4
X=X+1

if not inStr(RecSet("bild")) = "default.gif" or RecSet("bild") <> "" then
Response.Write "<img src='"& RecSet("bild") &"' width='80' height='100' title='"& RecSet("username") &"' border='0'>"
end if

RecSet.MoveNext
Loop

RecSet.Close
Connect.Close
Set RecSet = nothing
Set Connect = nothing
%>
```

Permalänk: https://www.webforum.nu/p/983504

## #3 — mikul, 2003-03-18T23:46Z

```
<% 
X = 0 
DO Until RecSet.EOF OR X = 4 
	X=X+1 
 
	if NOT LCase(RecSet("bild")) = "default.gif" then 
		Response.Write "<img src='"& RecSet("bild") &"' width='80' height='100' title='"& RecSet("username") &"' border='0'>" 
	end if 
 
	RecSet.MoveNext 
Loop 

RecSet.Close : Set RecSet = nothing 
Connect.Close : Set Connect = nothing 
%>
```

Borde nog funka ;)

/ Mikul

Permalänk: https://www.webforum.nu/p/983505

## #4 — mikul, 2003-03-18T23:48Z

Välkommen till wF föresten!

ps. Jag måste börja skriva snabbare för att hinna mä tempot i det här forumet ju ;)

/ Mikul

Permalänk: https://www.webforum.nu/p/983506

## #5 — solbulle, 2003-03-19T13:50Z

vänta nu....

Permalänk: https://www.webforum.nu/p/983787

## #6 — @nders, 2003-03-19T13:53Z

Förutom att Instr() inte fungerar så. ;)

```
if not inStr(RecSet("bild"), "default.gif") >0 AND RecSet("bild") <> "" then
```

Mvh

Permalänk: https://www.webforum.nu/p/983790

## #7 — solbulle, 2003-03-19T13:54Z

Asch, hann inte. Järnspik.

Såg precis det.

```
If not inStr(RecSet("bild"),"default.gif") AND RecSet("bild") <> "" then
```

Gör väl samma sak?

Permalänk: https://www.webforum.nu/p/983792

---

Tråden på webben: https://www.webforum.nu/amne/asp/71524-if-satser-och-else
