---
title: "Undantag i if-sats"
type: "forum-thread"
url: "https://www.webforum.nu/amne/asp/56731-undantag-i-if-sats"
topic: "ASP"
topic_url: "https://www.webforum.nu/amne/asp"
author: "bigsky"
published: "2002-10-21T21:51:35.000Z"
updated: "2002-10-21T23:49:12.000Z"
replies: 7
views: 253
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/56731-undantag-i-if-sats"
---

# Undantag i if-sats

## #1 — bigsky, 2002-10-21T21:51Z

I denna if-sats får jag ett "undantag":

```
<% If rs1("Id") = rs2("Id") Then
Response.Redirect("sida1.asp")
Else
Response.Redirect("sida2.asp")
End If %>
```

Felmeddelande:

> Feltyp:
> (0x80020009)
> Undantag inträffade.

Varför? Vad är det för undantag?

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

## #2 — LarsG, 2002-10-21T22:02Z

Finns det data i rs1 och rs2.?

```
<%
if not rs1.eof and not rs2.eof then
If rs1("Id") = rs2("Id") Then
Response.Redirect("sida1.asp")
end if
end if
Response.Redirect("sida2.asp")
%>
```

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

## #3 — bigsky, 2002-10-21T22:40Z

Nu står det istället:

Feltyp:
Körningsfel i Microsoft VBScript (0x800A01B6)
Objektet stöder inte egenskapen eller metoden.: 'EOF'

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

## #4 — LarsG, 2002-10-21T22:42Z

Jaha, är det tänkt att rs1 och rs2 skall vara recordset?

Du får nog visa lite mer kod.

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

## #5 — bigsky, 2002-10-21T22:48Z

jodå :)

```
<% If Not rs1("Id").EOF AND Not rs2("Id").EOF Then
   If rs1("Id") = rs2("Id") Then %>
   <td bgcolor="<% = color  %>" width="10%" height="30" valign="middle" align="center">
   <select size="1" name="id">
   <option value="<% = rs1("Id") %>"><% = rs1("Id") %></option>
   </select></td>
<% Else %>
   <td bgcolor="<% = color  %>" width="10%" height="30" valign="middle" align="center"><span class="text1"><% = rs1("Id") %></span></td>
<% End If
   End If %>
```

Och så en till, fast med Response.Redirect

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

## #6 — LarsG, 2002-10-21T22:51Z

Ändra

```
<% If Not rs1("Id").EOF AND Not rs2("Id").EOF Then
```

till 

```
<% If Not rs1.EOF AND Not rs2.EOF Then
```

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

## #7 — bigsky, 2002-10-21T22:54Z

ojdå, inte konstigt att du blev årets medlem. Du kan så mycket! Jobbar du med asp och sånt lr?

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

## #8 — LarsG, 2002-10-21T23:49Z

> Jobbar du med asp och sånt lr?

 

Nej, det är mer kompilatorteknik och systemprogrammering för min del.

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

---

Tråden på webben: https://www.webforum.nu/amne/asp/56731-undantag-i-if-sats
