Avatar billede neeo Nybegynder
25. marts 2004 - 18:33 Der er 11 kommentarer og
1 løsning

fejl i applikation

hjælpppppp


har fået en fejl , jeg ikke forstår.-

Microsoft OLE DB Provider for ODBC Drivers error '8007000e'

[Microsoft][ODBC Microsoft Access Driver] System resource exceeded.
opretbooking.asp, line 49





er der nogen der ved hvordan jeg løser det ??????
Avatar billede tubber Juniormester
25. marts 2004 - 18:59 #1
Kan du smide noget mere kode så der er mulighed for at se hvor fejlen opstår :)
Avatar billede neeo Nybegynder
25. marts 2004 - 19:34 #2
jamen det har mere med databasen at gøre end asp koden,
Avatar billede Slettet bruger
25. marts 2004 - 19:37 #3
Det er temmelig sikkert din kode som belaster databasen :-) Så som tubber siger så kom med koden så er det nemmere at se.
Avatar billede tubber Juniormester
25. marts 2004 - 19:50 #4
Når du med din sql statement beder den om at f.eks. kigge i en tabel som ikke findes får du en fejl som egenligt siger som din, eller hvis du leder efter et felt som ikke er der, eller du indtaster data fra en variabel (kan være en form) som er tom eller hvor du har en '' fejl eller en "" fejl......

Så din connection og sql statement er i hvert fald nødvendig for at kunne hjælpe.....
Avatar billede neoo Nybegynder
26. marts 2004 - 00:56 #5
<%

  Response.buffer = true
  Response.expires = 0
  Response.expiresabsolute = Now() - 1
  Response.addHeader "pragma", "no-cache"
  Response.addHeader "cache-control", "private"
  Response.CacheControl = "no-cache"

  if session("login") = "" Then
  Response.redirect("login.asp")
  end if

  Dim Error_Array()
  Dim j
  Dim Selected
  Dim ComboBox_Str
  Dim FirstRow
  Dim Arrival,Arrival1,navn,Antal,Antal1,PrisVoksenSalg,PrisVoksenSalg1,PrisBarnSalg,PrisBarnSalg1,PrisInfantSalg,PrisInfantSalg1,terminal,Terminal1
 
  Function OpretBooking()
   
    Response.Write("Opret Booking...")

  End Function

  Sub ShowReturnValue(aFe)
    Response.Write(Request.Form(aFe))
  End Sub

  Sub GetComboData(aFe,aSql)
    SQL_Str      = aSql
    ComboBox_Str = ""   
    Selected1    = False   
       
    Set DataConn = Server.CreateObject("ADODB.Connection")
    DataConn.ConnectionTimeout = 15
    DataConn.CommandTimeout    = 30
    DataConn.Open "driver={Microsoft Access Driver (*.mdb)};DBQ=" & Server.MapPath ("db/min.mdb") & ";uid=;pwd=;"
    Set cmdObj = Server.CreateObject("ADODB.Command")
    cmdObj.ActiveConnection = DataConn
    cmdObj.CommandText      = SQL_Str
    cmdObj.CommandType      = 1
    Set rsObj = Server.CreateObject("ADODB.Recordset")
    rsObj.Open cmdObj, ,0,1 
 
    If Not rsObj.EOF Then rsObj.MoveFirst

    ComboBox_Str = "<option>Vælg</option>"
    Do While Not rsObj.EOF
      if aFe = "flightnr" OR aFe = "flightnr1" then
        Flight_Str = rsObj.Fields(0).Value & " : " & rsObj.Fields(1).Value
        if Flight_Str = Request.Form(aFe) AND Request.Form(aFe) <> "Vælg" then
          Selected1 = True
          ComboBox_Str = ComboBox_Str & "<option selected='True' value='" & rsObj.Fields(0).Value & " : " & rsObj.Fields(1).Value &_
                        "'>" & rsObj.Fields(0).Value & " : " & rsObj.Fields(1).Value & "</option>"
        else
          ComboBox_Str = ComboBox_Str & "<option value='" & rsObj.Fields(0).Value & " : " & rsObj.Fields(1).Value &_
                        "'>" & rsObj.Fields(0).Value & " : " & rsObj.Fields(1).Value & "</option>"
        End if 
      else     
        if rsObj.Fields(0).Value = Request.Form(aFe) AND Request.Form(aFe) <> "Vælg" then
          Selected1 = True
          ComboBox_Str = ComboBox_Str & "<option value='" & rsObj.Fields(0).Value & "' selected='True'>" & rsObj.Fields(0).Value & "</option>"
        else
          ComboBox_Str = ComboBox_Str & "<option value='" & rsObj.Fields(0).Value & "'>" & rsObj.Fields(0).Value & "</option>"   
        End if
      End if 
      rsObj.MoveNext
    Loop

    ComboBox_Str = "<select name='" & aFe & "' onchange='document.forms[0].submit();' " &_ 
                  "id='selectbox'>" & ComboBox_Str & "</select>"
   
    Response.Write(ComboBox_Str)
    Selected    = Selected1
   
    rsObj.Close
    Set rsObj    = Nothing
    Set cmdObj  = Nothing
    DataConn.Close
    Set DataConn = Nothing
  End Sub
 
  Sub DisableCombobox(aFe)
    ComboBox_Str = "<select disabled='True' name='" & aFe & "' onchange='document.forms[0].submit();' " &_ 
                  "id='selectbox'><option selected='True'>Vælg</option></select>"
    Response.Write(ComboBox_Str)
  End Sub
 
  Sub ShowFra(aFe)
    if aFe = "Afrejse" then
      FirstRow = True
    else
      FirstRow = False 
    End if 
    GetComboData aFe,"SELECT Distinct x_afrejse FROM flight where x_antal > 0 ORDER BY x_afrejse ASC"
  End Sub

  Sub ShowTil(aFe) 
    if Selected then
      if FirstRow then
        Afrejse =  Request.Form("Afrejse")
      else
        Afrejse =  Request.Form("Afrejse1")
      End if
      Sql_Str = "SELECT Distinct x_ankomst FROM flight WHERE x_antal > 0 AND (x_afrejse='" &_
                Afrejse & "') ORDER BY x_ankomst ASC"             
      GetComboData aFe,Sql_Str
    else
      DisableCombobox(aFe)
    End if 
  End Sub
 
  Sub ShowFlight(aFe)
    if Selected then
      if FirstRow then
        Ankomst =  Request.Form("Ankomst")
        Afrejse =  Request.Form("Afrejse")
      else
        Ankomst =  Request.Form("Ankomst1")
        Afrejse =  Request.Form("Afrejse1")
      End if
   
      Sql_Str = "SELECT Distinct x_flightnr,x_Destairlines FROM flight WHERE x_antal > 0 AND (x_afrejse='" &_
                Afrejse & "') AND (x_ankomst='" & Ankomst &_
                "') ORDER BY x_Destairlines ASC"             
      GetComboData aFe,Sql_Str
    else
      DisableCombobox(aFe)
    End if 
  End Sub

  Sub ShowDato(aFe)
    if Selected then
      if FirstRow then
        Ankomst  =  Request.Form("Ankomst")
        Afrejse  =  Request.Form("Afrejse")
        Tmp_Array =  Split(Request.Form("flightnr"),":")
        Flightnr  =  Trim(Tmp_Array(0))
      else
        Ankomst  =  Request.Form("Ankomst1")
        Afrejse  =  Request.Form("Afrejse1")
        Tmp_Array =  Split(Request.Form("flightnr1"),":")
        Flightnr  =  Trim(Tmp_Array(0))
      End if
      Sql_Str = "SELECT Distinct x_afrejsedato FROM flight WHERE x_antal > 0 AND (x_afrejse='" &_
                Afrejse & "') AND (x_ankomst='" & Ankomst &_
                "') AND (x_flightnr='" & Flightnr & "') ORDER BY x_afrejsedato ASC"             
      GetComboData aFe,Sql_Str
    else
      DisableCombobox(aFe)
    End if 
  End Sub

  Sub ShowDepart(aFe)
    if Selected then
      if FirstRow then
        Ankomst    =  Request.Form("Ankomst")
        Afrejse    =  Request.Form("Afrejse")
        Tmp_Array  =  Split(Request.Form("flightnr"),":")
        Flightnr    =  Trim(Tmp_Array(0))
        Afrejsedato =  Request.Form("afrejsedato")
      else
        Ankomst    =  Request.Form("Ankomst1")
        Afrejse    =  Request.Form("Afrejse1")
        Tmp_Array  =  Split(Request.Form("flightnr1"),":")
        Flightnr    =  Trim(Tmp_Array(0))
        Afrejsedato =  Request.Form("hjemrejsedato")
      End if
      Sql_Str = "SELECT x_depart FROM flight WHERE x_antal > 0 AND (x_afrejse='" &_
                Afrejse & "') AND (x_ankomst='" & Ankomst &_
                "') AND (x_flightnr='" & Flightnr & "') " &_
                "AND (x_afrejsedato='" & Afrejsedato & "') ORDER BY x_depart ASC"             
      GetComboData aFe,Sql_Str
    else
      DisableCombobox(aFe)
    End if 
  End Sub

  Sub ShowArrival(aFe)
    if Selected then
      if FirstRow then
        Afrejse    =  Request.Form("Afrejse")
        Tmp_Array  =  Split(Request.Form("flightnr"),":")
        Flightnr    =  Trim(Tmp_Array(0))
        Afrejsedato =  Request.Form("afrejsedato")
        Depart      =  Request.Form("depart")
      else
        Afrejse    =  Request.Form("Afrejse1")
        Tmp_Array  =  Split(Request.Form("flightnr1"),":")
        Flightnr    =  Trim(Tmp_Array(0))
        Afrejsedato =  Request.Form("hjemrejsedato")
        Depart      =  Request.Form("depart1")
      End if
     
      Sql_Str = "SELECT x_arrival,x_antal,x_PrisVoksenSalg,x_PrisBarnSalg," &_
                "x_PrisInfantSalg,x_terminal FROM flight WHERE x_antal > 0 AND (x_afrejse='" &_
                Afrejse & "') AND (x_flightnr='" & Flightnr & "') " &_
                "AND (x_afrejsedato='" & Afrejsedato & "') AND (" &_
                "x_depart='" & Depart & "')"             
     
      Set DataConn = Server.CreateObject("ADODB.Connection")
      DataConn.ConnectionTimeout = 15
      DataConn.CommandTimeout    = 30
      DataConn.Open "driver={Microsoft Access Driver (*.mdb)};DBQ=" & Server.MapPath ("db/min.mdb") & ";uid=;pwd=;"
      Set cmdObj = Server.CreateObject("ADODB.Command")
      cmdObj.ActiveConnection = DataConn
      cmdObj.CommandText      = SQL_Str
      cmdObj.CommandType      = 1
      Set rsObj = Server.CreateObject("ADODB.Recordset")
      rsObj.Open cmdObj, ,0,1 
 
      If Not rsObj.EOF Then rsObj.MoveFirst
     
      if FirstRow then
        Arrival        = rsObj.Fields(0).Value
        Antal          = rsObj.Fields(1).Value
        PrisVoksenSalg  = rsObj.Fields(2).Value
        PrisBarnSalg    = rsObj.Fields(3).Value
        PrisInfantSalg  = rsObj.Fields(4).Value
        Terminal        = rsobj.Fields(5).Value
        Response.Write Arrival
      else
        Arrival1        = rsObj.Fields(0).Value
        Antal1          = rsObj.Fields(1).Value
        PrisVoksenSalg1 = rsObj.Fields(2).Value
        PrisBarnSalg1  = rsObj.Fields(3).Value
        PrisInfantSalg1 = rsObj.Fields(4).Value
        Terminal1    = rsobj.Fields(5).Value       
        Response.Write Arrival1
      End if
       
      rsObj.Close
      Set rsObj    = Nothing
      Set cmdObj  = Nothing
      DataConn.Close
      Set DataConn = Nothing
    End if 
  End Sub

  Sub ShowAntal
    if FirstRow then
      Response.Write(Antal)
    else
      Response.Write(Antal1)
    End if
  End Sub
 
Sub ShowTerminal
    if FirstRow then
      Response.Write("<span id='anter'>" & terminal & "</span>")
    else
      Response.Write("<span id='anter'>" & terminal1 & "</span>")
    End if
  End Sub
 
  Sub ShowFlyID
    if Selected then
      if FirstRow then
        Afrejse    =  Request.Form("Afrejse")
        Tmp_Array  =  Split(Request.Form("flightnr"),":")
        Flightnr    =  Trim(Tmp_Array(0))
        Afrejsedato =  Request.Form("afrejsedato")
        Depart      =  Request.Form("depart")
      else
        Afrejse    =  Request.Form("Afrejse1")
        Tmp_Array  =  Split(Request.Form("flightnr1"),":")
        Flightnr    =  Trim(Tmp_Array(0))
        Afrejsedato =  Request.Form("hjemrejsedato")
        Depart      =  Request.Form("depart1")
      End if
     
      Sql_Str = "SELECT ID FROM flight WHERE x_antal > 0 AND (x_afrejse='" &_
                Afrejse & "') AND (x_flightnr='" & Flightnr & "') " &_
                "AND (x_afrejsedato='" & Afrejsedato & "') AND (" &_
                "x_depart='" & Depart & "')"
               
      Set DataConn = Server.CreateObject("ADODB.Connection")
      DataConn.ConnectionTimeout = 15
      DataConn.CommandTimeout    = 30
      DataConn.Open "driver={Microsoft Access Driver (*.mdb)};DBQ=" & Server.MapPath ("db/min.mdb") & ";uid=;pwd=;"
      Set cmdObj = Server.CreateObject("ADODB.Command")
      cmdObj.ActiveConnection = DataConn
      cmdObj.CommandText      = SQL_Str
      cmdObj.CommandType      = 1
      Set rsObj = Server.CreateObject("ADODB.Recordset")
      rsObj.Open cmdObj, ,0,1 
 
      If Not rsObj.EOF Then rsObj.MoveFirst
   
    if FirstRow then
      Response.Write("<input type='hidden' name='FlyID' value='" & rsObj.Fields(0).Value & "'>")
    else
      Response.Write("<input type='hidden' name='FlyID1' value='" & rsObj.Fields(0).Value & "'>")
    End if
       
      rsObj.Close
      Set rsObj    = Nothing
      Set cmdObj  = Nothing
      DataConn.Close
      Set DataConn = Nothing
    End if
  End Sub

  Sub ShowError(aFE)
    ReturnValue = ""
    For Each Ele In Error_Array
      if Ele = aFE then
        ReturnValue = "<span style='font-weight: 700; color: red; font-size: 12px;'>*</span>"     
        Exit For
      end if
    Next
    'Response.Write(Ele)
    Response.Write(ReturnValue)
  end Sub

  Function BookingCheck
    if Request.Form("Action") = "" then
      BookingCheck = 1
      Exit Function
    end if

    i    = -1
    j    = 0
    Error = False   
   
    Redim Error_Array(1)   
   
    if not IsNumeric(Request.form("x_postnr")) then
      Error = True
      j = j + 1
      ReDim Preserve Error_Array(j)   
      Error_Array(j-1) = "x_postnr"
    end if
    if not IsNumeric(Request.form("x_Telefon")) then
      Error = True
      j = j + 1
      ReDim Preserve Error_Array(j)   
      Error_Array(j-1) = "x_Telefon"
    end if
    if Request.form("x_navn") = "" then
      Error = True
      j = j + 1
      ReDim Preserve Error_Array(j)   
      Error_Array(j-1) = "x_navn"
    end if
    if Request.form("x_adresse") = "" then
      Error = True
      j = j + 1
      ReDim Preserve Error_Array(j)   
      Error_Array(j-1) = "x_adresse"
    end if
    if Request.form("Afrejse") = "Vælg" or Request.form("Afrejse") = "" then
      Error = True
      j = j + 1
      ReDim Preserve Error_Array(j)   
      Error_Array(j-1) = "Afrejse"
    end if
    if Request.form("x_city") = "" then
      Error = True
      j = j + 1
      ReDim Preserve Error_Array(j)   
      Error_Array(j-1) = "x_city"
    end if
    if Request.form("Ankomst") = "Vælg" or Request.form("Ankomst") = "" then
      Error = True
      j = j + 1
      ReDim Preserve Error_Array(j)   
      Error_Array(j-1) = "Ankomst"
    end if
    if Request.form("flightnr") = "Vælg" or Request.form("flightnr") = "" then
      Error = True
      j = j + 1
      ReDim Preserve Error_Array(j)   
      Error_Array(j-1) = "flightnr"
    end if
    if Request.form("afrejsedato") = "Vælg" or Request.form("afrejsedato") = "" then
      Error = True
      j = j + 1
      ReDim Preserve Error_Array(j)   
      Error_Array(j-1) = "afrejsedato"
    end if
    if Request.form("depart") = "Vælg" or Request.form("depart") = "" then
      Error = True
      j = j + 1
      ReDim Preserve Error_Array(j)   
      Error_Array(j-1) = "depart"
    end if
    AntalV = Request.form("x_AntalVoksenSalg1")
    AntalB = Request.form("x_AntalBarnSalg1")
    AntalI = Request.form("x_AntalInfantSalg1")
    if AntalV = "" then
    AntalV = 0
    end if
    if AntalB = "" then
    AntalB = 0
    end if
    if AntalI = "" then
    AntalI = 0
    end if
    tallet = int(AntalV+AntalB+AntalI)
    if tallet = 0 then
      Error = True
      j = j + 1
      ReDim Preserve Error_Array(j)   
      Error_Array(j-1) = "x_AntalVoksenSalg"
    end if
    if Request.form("Betbetingelser") = "" then
      Error = True
      j = j + 1
      ReDim Preserve Error_Array(j)   
      Error_Array(j-1) = "Betbetingelser"
    end if
   
    if Error then
      BookingCheck = 1
      Exit Function
    end if
  end Function
 
  if BookingCheck = 0 then
      OpretBillet
  end if
 
  function OpretBillet

Temp_des_fli1 = Split(Request.form("flightnr"),":")
xx_Destairlines = Temp_des_fli1(1)
xx_flightnr = Temp_des_fli1(0)

if trim(Request.form("flightnr1")) & "x" = "x" then
response.write ""
else
Temp_des_fli2 = Split(Request.form("flightnr1"),":")
xx_Destairlines1 = Temp_des_fli2(1)
xx_flightnr1 = Temp_des_fli2(0)
end if

'Alle formene ligges i variabler
x_navn = Trim(Request.form("x_navn"))
x_adresse = Trim(Request.form("x_adresse"))
x_postnr = Request.form("x_postnr")
x_city = Trim(Request.form("x_city"))
x_Telefon = Request.form("x_Telefon")
x_email = Trim(Request.form("x_email"))
x_Deltager = Request.form("x_Deltager")
x_Afrejse = Trim(Request.form("Afrejse"))
x_Ankomst = Trim(Request.form("Ankomst"))
x_flightnr = Trim(xx_flightnr)
x_Destairlines = Trim(xx_Destairlines)
x_afrejsedato = Request.form("afrejsedato")
x_depart = Request.form("depart")
x_arrival = Request.form("Arrival")
x_Afrejse1 = Trim(Request.form("Afrejse1"))
x_Ankomst1 = Trim(Request.form("Ankomst1"))
x_flightnr1 = Trim(xx_flightnr1)
x_Destairlines1 = Trim(xx_Destairlines1)
x_hjemrejsedato = Request.form("hjemrejsedato")
x_depart1 = Request.form("depart1")
x_arrival1 = Request.form("Arrival1")
x_AntalVoksenSalg = Request.form("x_AntalVoksenSalg1")
x_AntalBarnSalg = Request.form("x_AntalBarnSalg1")
x_AntalInfantSalg = Request.form("x_AntalInfantSalg1")
x_Billetnummer = Trim(Request.form("Billetnummer"))
x_Betbetingelser = Trim(Request.form("Betbetingelser"))
x_PrisVoksenSalg = Replace(Request.form("x_PrisVoksenSalg"),".",",")
x_PrisBarnSalg = Replace(Request.form("x_PrisBarnSalg"),".",",")
x_PrisInfantSalg = Replace(Request.form("x_PrisInfantSalg"),".",",")
x_Depositium = Replace(Request.form("x_Depositium"),".",",")
x_Betsenest = Request.form("x_Betsenest")
x_restbelob = Replace(Request.form("x_restbelob"),".",",")
x_Totalalle = Request.form("x_Totalalle")
x_total = Request.form("x_total")
x_Profit = Request.form("x_Profit")
x_forsikring = Replace(Request.form("x_forsikring"),".",",")
x_medarbejder = Session("Brugernavn")
x_FlyID = Request.form("FlyID")
x_FlyID1 = Request.form("FlyID1")
x_besked = Request.form("Besked")

If trim(x_FlyID) & "x" = "x" Then x_FlyID = Null
If trim(x_FlyID1) & "x" = "x" Then x_FlyID1 = Null

Datoen = Now()
Datoen = replace(Datoen,"/","-")
Datoen1 = split(Datoen," ")

Maaned = Mid(Datoen,4,2)
if Maaned = 1 OR Maaned = 01 then
x_Maaned = "Januar"
elseif Maaned = 2 OR Maaned = 02  then
x_Maaned = "Februar"
elseif Maaned = 3 OR Maaned = 03  then
x_Maaned = "Marts"
elseif Maaned = 4 OR Maaned = 04  then
x_Maaned = "April"
elseif Maaned = 5 OR Maaned = 05  then
x_Maaned = "Maj"
elseif Maaned = 6 OR Maaned = 06  then
x_Maaned = "Juni"
elseif Maaned = 7 OR Maaned = 07  then
x_Maaned = "Juli"
elseif Maaned = 8 OR Maaned = 08  then
x_Maaned = "August"
elseif Maaned = 9 OR Maaned = 09  then
x_Maaned = "September"
elseif Maaned = 10 then
x_Maaned = "Oktober"
elseif Maaned = 11 then
x_Maaned = "November"
elseif Maaned = 12 then
x_Maaned = "December"
end if

        Set DataConn = Server.CreateObject("ADODB.Connection")
        DataConn.Open "driver={Microsoft Access Driver (*.mdb)};DBQ=" & Server.MapPath ("db/min.mdb") & ";uid=;pwd=;"
       
        strsql = "SELECT * FROM OpretBooking"
        set rs = Server.CreateObject("ADODB.Recordset")
        rs.Open strsql, Dataconn, 1, 2
       
        rs.AddNew
        rs("FlyID") = x_FlyID
        rs("FlyID1") = x_FlyID1
        rs("Maaned") = x_Maaned
        rs("dato") = Datoen1(0)

tmpFld = Trim(x_besked)
If trim(tmpFld) & "x" = "x" Then tmpFld = Null
rs("nota") = tmpFld

tmpFld = Trim(x_Betbetingelser)
If trim(tmpFld) & "x" = "x" Then tmpFld = Null
rs("Betbetingelser") = tmpFld

tmpFld = Trim(x_adresse)
If trim(tmpFld) & "x" = "x" Then tmpFld = Null
rs("adresse") = tmpFld

tmpFld = Trim(x_navn)
If trim(tmpFld) & "x" = "x" Then tmpFld = Null
rs("navn") = tmpFld

tmpFld = x_postnr
If Not IsNumeric(tmpFld) Then tmpFld = 0
rs("postnr") = cLng(tmpFld)

tmpFld = Trim(x_city)
If trim(tmpFld) & "x" = "x" Then tmpFld = Null
rs("city") = tmpFld

tmpFld = x_Telefon
If Not IsNumeric(tmpFld) Then tmpFld = 0
rs("Telefon") = cLng(tmpFld)

tmpFld = x_total
If Not IsNumeric(tmpFld) Then tmpFld = 0
rs("total") = cLng(tmpFld)

tmpFld = x_Profit
If Not IsNumeric(tmpFld) Then tmpFld = 0
rs("Profit") = cLng(tmpFld)

tmpFld = Trim(x_email)
If trim(tmpFld) & "x" = "x" Then tmpFld = Null
rs("email") = tmpFld
tmpFld = Trim(x_Deltager)
If trim(tmpFld) & "x" = "x" Then tmpFld = Null
rs("Deltager") = tmpFld

tmpFld = Trim(x_afrejse)
If trim(tmpFld) & "x" = "x" Then tmpFld = Null
rs("afrejse") = tmpFld
tmpFld = Trim(x_afrejse1)
If trim(tmpFld) & "x" = "Vælgx" Then tmpFld = Null
rs("afrejse1") = tmpFld

tmpFld = Trim(x_ankomst)
If trim(tmpFld) & "x" = "x" Then tmpFld = Null
rs("ankomst") = tmpFld

tmpFld = Trim(x_ankomst1)
If trim(tmpFld) & "x" = "x" Then tmpFld = Null
rs("ankomst1") = tmpFld


tmpFld = x_afrejsedato
If IsDate(tmpFld) Then
    rs("afrejsedato") = cDate(tmpFld)
Else
    rs("afrejsedato") = Null
End If

tmpFld = x_hjemrejsedato
If IsDate(tmpFld) Then
    rs("hjemrejsedato") = cDate(tmpFld)
Else
    rs("hjemrejsedato") = Null
End If
tmpFld = Trim(x_Destairlines)
If trim(tmpFld) & "x" = "x" Then tmpFld = Null
rs("Destairlines") = tmpFld

tmpFld = Trim(x_Destairlines1)
If trim(tmpFld) & "x" = "x" Then tmpFld = Null
rs("Destairlines1") = tmpFld

tmpFld = Trim(x_depart)
If trim(tmpFld) & "x" = "x" Then
  tmpFld = Null
else
  tmpFld = Left(tmpFld,2) & ":" & Right(tmpFld,2)
end if
rs("depart") = tmpFld

tmpFld = Trim(x_depart1)
If trim(tmpFld) & "x" = "x" Then
  tmpFld = Null
else
  tmpFld = Left(tmpFld,2) & ":" & Right(tmpFld,2)
end if
rs("depart1") = tmpFld

tmpFld = Trim(x_arrival1)
If trim(tmpFld) & "x" = "x" Then
  tmpFld = Null
else
  tmpFld = Left(tmpFld,2) & ":" & Right(tmpFld,2)
end if
rs("arrival1") = tmpFld

tmpFld = Trim(x_arrival)
If trim(tmpFld) & "x" = "x" Then
  tmpFld = Null
else
  tmpFld = Left(tmpFld,2) & ":" & Right(tmpFld,2)
end if
rs("arrival") = tmpFld

tmpFld = Trim(x_terminal)
If trim(tmpFld) & "x" = "x" Then tmpFld = Null
rs("terminal") = tmpFld

tmpFld = Trim(x_terminal1)
If trim(tmpFld) & "x" = "x" Then tmpFld = Null
rs("terminal1") = tmpFld

tmpFld = Trim(x_flightnr)
If trim(tmpFld) & "x" = "x" Then tmpFld = Null
rs("flightnr") = tmpFld

tmpFld = Trim(x_flightnr1)
If trim(tmpFld) & "x" = "x" Then tmpFld = Null
rs("flightnr1") = tmpFld

tmpFld = x_Betsenest
If IsDate(tmpFld) Then
    rs("Betsenest") = cDate(tmpFld)
Else
    rs("Betsenest") = Null
End If

TotalFld=0
tmpFld = x_PrisVoksenSalg
If Not IsNumeric(tmpFld) Then tmpFld = 0
rs("PrisVoksenSalg") = cDbl(tmpFld)
TotalFld=TotalFld+cDbl(tmpFld)

tmpFld = x_AntalVoksenSalg
If Not IsNumeric(tmpFld) Then tmpFld = 0
rs("AntalVoksenSalg") = cLng(tmpFld)
TotalFld=TotalFld*cDbl(tmpFld)

tmpFld = x_Provision
If Not IsNumeric(tmpFld) Then tmpFld = 0
rs("Provision") = cDbl(tmpFld)
TotalFld=TotalFld+cLng(tmpFld)

rs("TotalSalgVoksen") = TotalFld

TotalFld=0
tmpFld = x_PrisBarnSalg
If Not IsNumeric(tmpFld) Then tmpFld = 0
rs("PrisBarnSalg") = cDbl(tmpFld)
TotalFld=TotalFld+cDbl(tmpFld)

tmpFld = x_AntalBarnSalg
If Not IsNumeric(tmpFld) Then tmpFld = 0
rs("AntalBarnSalg") = cLng(tmpFld)
TotalFld=TotalFld*cDbl(tmpFld)

rs("TotalSalgbarn") = TotalFld

TotalFld=0
tmpFld = x_PrisInfantSalg
If Not IsNumeric(tmpFld) Then tmpFld = 0
rs("PrisInfantSalg") = cDbl(tmpFld)
TotalFld=TotalFld+cDbl(tmpFld)

tmpFld = x_AntalInfantSalg
If Not IsNumeric(tmpFld) Then tmpFld = 0
rs("AntalInfantSalg") = cLng(tmpFld)
TotalFld=TotalFld*cDbl(tmpFld)

TotalFld=0
tmpFld = x_PrisVoksenSalg
If Not IsNumeric(tmpFld) Then tmpFld = 0
rs("PrisVoksenSalg") = cDbl(tmpFld)
TotalFld=TotalFld+cLng(tmpFld)*rs("antalVoksenSalg")

tmpFld = x_PrisBarnSalg
If Not IsNumeric(tmpFld) Then tmpFld = 0
rs("PrisBarnSalg") = cDbl(tmpFld)
TotalFld=TotalFld+cLng(tmpFld)*rs("antalbarnSalg")

tmpFld = x_PrisInfantSalg
If Not IsNumeric(tmpFld) Then tmpFld = 0
rs("PrisInfantSalg") = cDbl(tmpFld)
TotalFld=TotalFld+cDbl(tmpFld)*rs("antalinfantSalg")

TotalFld=0
tmpFld = x_PrisVoksenSalg
If Not IsNumeric(tmpFld) Then tmpFld = 0
rs("PrisVoksenSalg") = cDbl(tmpFld)
TotalFld=TotalFld+cLng(tmpFld)*rs("antalVoksenSalg")

tmpFld = x_PrisBarnSalg
If Not IsNumeric(tmpFld) Then tmpFld = 0
rs("PrisBarnSalg") = cDbl(tmpFld)
TotalFld=TotalFld+cLng(tmpFld)*rs("antalbarnSalg")

tmpFld = x_PrisInfantSalg
If Not IsNumeric(tmpFld) Then tmpFld = 0
rs("PrisInfantSalg") = cDbl(tmpFld)
TotalFld=TotalFld+cDbl(tmpFld)*rs("antalinfantSalg")

tmpFld = x_Depositium
If Not IsNumeric(tmpFld) Then tmpFld = 0
rs("Depositium") = cDbl(tmpFld)
TotalFld=TotalFld-cLng(tmpFld)

tmpFld = Trim(x_forsikring)
If trim(tmpFld) & "x" = "x" Then tmpFld = Null
rs("forsikring") = tmpFld
forsikringtemp = tmpFld

rs("Restbelob") = TotalFld+forsikringtemp

tmpFld = Trim(x_medarbejder)
If trim(tmpFld) & "x" = "x" Then tmpFld = Null
rs("medarbejder") = tmpFld

tmpFld = x_Totalalle
If Not IsNumeric(tmpFld) Then tmpFld = 0
rs("Totalalle") = cDbl(tmpFld)


tmpFld = Trim(x_Billetnummer)
If trim(tmpFld) & "x" = "x" Then tmpFld = Null
rs("Billetnummer") = tmpFld

TotalFld=0
tmpFld = x_PrisVoksenSalg
If Not IsNumeric(tmpFld) Then tmpFld = 0
rs("PrisVoksenSalg") = cDbl(tmpFld)
TotalFld=TotalFld+cLng(tmpFld)*rs("antalVoksenSalg")
PrisVoksenSalgTemp = cDbl(tmpFld)


tmpFld = x_Provision
If Not IsNumeric(tmpFld) Then tmpFld = 0
rs("Provision") = cDbl(tmpFld)
TotalFld=TotalFld+cLng(tmpFld)


tmpFld = x_PrisBarnSalg
If Not IsNumeric(tmpFld) Then tmpFld = 0
rs("PrisBarnSalg") = cDbl(tmpFld)
TotalFld=TotalFld+cLng(tmpFld)*rs("antalbarnSalg")
PrisBarnSalgTemp = cDbl(tmpFld)



tmpFld = x_PrisInfantSalg
If Not IsNumeric(tmpFld) Then tmpFld = 0
rs("PrisInfantSalg") = cDbl(tmpFld)
TotalFld=TotalFld+cLng(tmpFld)*rs("antalinfantSalg")
PrisInfantSalgTemp = cDbl(tmpFld)



rs("provision") = TotalFld

rs("TotalSalgVoksen") = PrisVoksenSalgTemp
rs("TotalSalgbarn") = PrisBarnSalgTemp
rs("TotalSalgInfant") = PrisInfantSalgTemp
rs("TotalSalg") = forsikringtemp+PrisVoksenSalgTemp+PrisBarnSalgTemp+PrisInfantSalgTemp
        rs("type") = "snowflake"
        rs.update
       
    response.redirect "Opretbookingcheck.asp?dis=yes"
  end Function
%>

<html>
<head>
      <title>Opret booking</title>
      <LINK REL=STYLESHEET HREF="OpretBooking.css" TYPE="text/css">
      <script language="javascript1.2" type="text/javascript" src="OpretBooking.js"></script><script>
      function udregn2(f){
       
        x_PVSalg = (!isNaN(f.x_PrisVoksenSalg.value))?+f.x_PrisVoksenSalg.value:0;
        x_PBSalg = (!isNaN(f.x_PrisBarnSalg.value))?+f.x_PrisBarnSalg.value:0;
        x_PISalg = (!isNaN(f.x_PrisInfantSalg.value))?+f.x_PrisInfantSalg.value:0;
        x_AntalVoksne = (!isNaN(f.x_AntalVoksenSalg.value))?+f.x_AntalVoksenSalg.value:1;
        x_AntalBarn = (!isNaN(f.x_AntalBarnSalg.value))?+f.x_AntalBarnSalg.value:1;
        x_AntalInfant = (!isNaN(f.x_AntalInfantSalg.value))?+f.x_AntalInfantSalg.value:1;
        x_Fos= (!isNaN(f.x_forsikring.value))?+f.x_forsikring.value:0;
        x_Dep= (!isNaN(f.x_Depositium.value))?+f.x_Depositium.value:0;
        f.x_restbelob.value = (((x_PVSalg*x_AntalVoksne)+(x_PBSalg*x_AntalBarn)+(x_PISalg*x_AntalInfant))-x_Dep)+x_Fos;

        }
       
        function udregn(f){
        x_AVSalg = (f.x_AntalVoksenSalg.value!="")?+f.x_AntalVoksenSalg.value:0;
        x_PVSalg = (!isNaN(f.x_PrisVoksenSalg.value))?+f.x_PrisVoksenSalg.value:0;
        x_ABSalg = (f.x_AntalBarnSalg.value!="")?+f.x_AntalBarnSalg.value:0;
        x_PBSalg = (!isNaN(f.x_PrisBarnSalg.value))?+f.x_PrisBarnSalg.value:0;
        x_AISalg = (f.x_AntalInfantSalg.value!="")?+f.x_AntalInfantSalg.value:0;
        x_PISalg = (!isNaN(f.x_PrisInfantSalg.value))?+f.x_PrisInfantSalg.value:0;
        x_Fos= (!isNaN(f.x_forsikring.value))?+f.x_forsikring.value:0;
        x_Dep= (!isNaN(f.x_Depositium.value))?+f.x_Depositium.value:0;
        f.x_total.value = x_PVSalg*x_AVSalg+x_PBSalg*x_ABSalg+x_PISalg*x_AISalg;
        f.x_restbelob.value = x_PVSalg*x_AVSalg+x_PBSalg*x_ABSalg+x_PISalg*x_AISalg+x_Fos-x_Dep;
        }

      function checkfejl(f)
      {
        Antal_1 = (f.Antal_1.value!="")?+f.Antal_1.value:0;
        Antal_2 = (f.Antal_2.value!="")?+f.Antal_2.value:0;
       
        if(Antal_1 < 0) {
        alert("Antallet af passegere passer ikke overens med antal på afrejsefly.");
        document.form1.Action.disabled=true;
        return true ;
        } else if(Antal_1 >= 0) {
        document.form1.Action.disabled=false;
        return true ;
        }
        if(Antal_2 < 0) {
        alert("Antallet af passegere passer ikke overens med antal på hjemrejsefly.");
        document.form1.Action.disabled=true;
        return true ;
        } else if(Antal_2 >= 0) {
        document.form1.Action.disabled=false;
        return true ;
        }
       
       
      }
      function checkantal(f)
                {
                x_AntalVoksenSalg1 = (f.x_AntalVoksenSalg1.value!="")?+f.x_AntalVoksenSalg1.value:0;
                x_AntalBarnSalg1 = (f.x_AntalBarnSalg1.value!="")?+f.x_AntalBarnSalg1.value:0;
                x_AntalInfantSalg1 = (f.x_AntalInfantSalg1.value!="")?+f.x_AntalInfantSalg1.value:0;
               
               
                x_AntalVoksenSalg = (f.x_AntalVoksenSalg.value!="")?+f.x_AntalVoksenSalg.value:0;
                x_AntalBarnSalg = (f.x_AntalBarnSalg.value!="")?+f.x_AntalBarnSalg.value:0;
                x_AntalInfantSalg = (f.x_AntalInfantSalg.value!="")?+f.x_AntalInfantSalg.value:0;
               
                f.x_AntalVoksenSalg1.value = (f.x_AntalVoksenSalg.value!="")?+f.x_AntalVoksenSalg.value:0;
                f.x_AntalBarnSalg1.value = (f.x_AntalBarnSalg.value!="")?+f.x_AntalBarnSalg.value:0;
                f.x_AntalInfantSalg1.value = (f.x_AntalInfantSalg.value!="")?+f.x_AntalInfantSalg.value:0;
               
                Antalfix1 = (f.Antalfix1.value!="")?+f.Antalfix1.value:0;
                Antalfix2 = (f.Antalfix2.value!="")?+f.Antalfix2.value:0;
               
                f.Antal_1.value = Antalfix1-(x_AntalVoksenSalg+x_AntalBarnSalg)
<% if request.form("Afrejse1") = "" or Request.form("Afrejse1") = "Vælg" then
response.write ""
else %>
                f.Antal_2.value = Antalfix2-(x_AntalVoksenSalg+x_AntalBarnSalg)
<% end if %>
                Antal1eren = (f.Antal_1.value!="")?+f.Antal_1.value:0;
                if (Antal1eren < 1) {
                    alert("Billetantallet er 0!");
                }
<% if request.form("Afrejse1") = "" or Request.form("Afrejse1") = "Vælg" then
response.write ""
else
%>
                Antal2eren = (f.Antal_2.value!="")?+f.Antal_2.value:0;
                if (Antal2eren < 1) {
                    alert("Billetantallet er 0!");
                }
<% end if %>
                }
               

function pro(f){
x_Totalalle = (f.x_Totalalle.value!="")?+f.x_Totalalle.value:0;
x_total = (f.x_total.value!="")?+f.x_total.value:0;
f.x_Profit.value = x_total-x_Totalalle;
}

function beskedpop() {
    window.open('RetAntalFlight.asp?mode=besked','SkrivBesked','Height=215,width=375,left=120,top=120')
}

function Checkbesked() {
    if (document.getElementById("popupbesked").value.length > 0) {
        document.getElementById("popupbeskedsknap").style.backgroundColor='red'
        document.getElementById("popupbeskedsknap").style.color='white'
    }
}
      </script>
   
</head>
<body style="font-size:12px;" onload="checkfejl(document.form1);Checkbesked();">

<form method="post" action="opretbooking.asp" name="form1">
              <table cellpadding="0" cellspacing="0" width="450" border="0" id="table22">
                    <tr class="GenRow">
                        <td bgcolor="#4682B4" style="color: #000000; font-family:Tahoma,Verdana; font-size: 11px">
                            <table cellpadding="5" cellspacing="1" width="100%" border="0" id="table23">
                                  <tr class="GenRow">
                                    <td bgcolor="#DBEAF5"><p align="left">
                                        <font face="tahoma, verdana" size="2"><b>Kunde Oplysninger</b></font>
                                    </td>
                                  </tr>
                                  <tr class="GenRow">
                                    <td bgcolor="#ffffff" valign="top" style="color:#000000; font-family: Tahoma, Verdana;font-size: 11px">
                                        <table border="1" width="653" height="106" bgcolor="#FFFFFF" id="table24"
                                              style="border-collapse:collapse">
                                              <tr>
                                                  <td width="104" height="28" class="GenCol">
                                                      Navn
                                                  </td>
                                                  <td width="186" height="28" bgcolor="#FFFFFF" colspan="2">
                                                      <font size="1" face="Verdana">
                                                      <input name="x_navn" value="<% ShowReturnValue("x_navn") %>" id="personform" maxlength=50></font></td>
                                                  <td width="182" height="28" bgcolor="#FFFFFF"><% ShowError "x_navn" %></td>
                                              </tr>
                                              <tr>
                                                <td width="104" height="24" class="GenCol">
                                                    Adresse
                                                </td>
                                                <td width="186" height="24" colspan="2"><font face="Arial" size="-1">
                                                    <input id="personform" name="x_adresse" value="<% ShowReturnValue("x_adresse") %>"></td>
                                               
                                                <td width="132" height="24"><% ShowError "x_adresse" %></td>
                                              </tr>
                                              <tr>
                                                <td width="104" height="23" class="GenCol">
                                                    Postnr. &amp; by
                                                </td>
                                                <td height="23"><font face="Arial" size="-1">
                                                    <font size="1" face="Verdana"><input size="8" name="x_postnr"
                                                          value="<% ShowReturnValue("x_postnr") %>"><% ShowError "x_postnr" %></font>
                                                </td>
                                                <td height="23"><font face="Arial" size="-1">
                                                    <font size="1" face="Verdana"><input style="width: 212px;" name="x_city"
                                                      value="<% ShowReturnValue("x_city") %>"></font>
                                                </td>
                                                <td width="132" height="12"><% ShowError "x_city" %></td>
                                              </tr>
                                              <tr>
                                                <td width="104" height="12" class="GenCol">
                                                    Telefon
                                                </td>
                                                <td width="186" height="12" colspan="2"><font face="Arial" size="-1">
                                                    <input id="personform" name="x_Telefon" value="<% ShowReturnValue("x_Telefon") %>"></font>
                                                </td>
                                             
                                                <td width="132" height="12"><% ShowError "x_Telefon" %></td>
                                              </tr>
                                              <tr>
                                                <td width="104" height="6" class="GenCol">
                                                    Email
                                                </td>
                                                <td width="186" height="6" colspan="2"><font face="Arial" size="-1">
                                                    <input id="personform" name="x_email" value="<% ShowReturnValue("x_email") %>"></font>
                                                </td>
                                             
                                                <td width="132" height="6">&nbsp;</td>
                                              </tr>
                                              <tr>
                                                <td width="104" height="5" class="GenCol">
                                                    Deltager liste
                                                </td>
                                                <td height="5" colspan="2"><font size="1" face="Verdana">
                                                    <textarea name="x_Deltager" rows="3" id="personform"><%
                                                    ShowReturnValue("x_Deltager") %></textarea>
                                                    </font>
                                                </td>
                                             
                                                <td width="132" height="5">&nbsp;</td>
                                              </tr>
                                        </table>   
                                    </td>
                                  </tr>         
                            </table>
                        </td>
                    </tr>
              </table>
              <br><br> 
              <table cellpadding="0" cellspacing="0" width="450" border="0" id="table6">
                    <tr class="GenRow">
                        <td bgcolor="#4682B4" style="color: #000000; font-family:Tahoma,Verdana; font-size: 11px">
                            <table cellpadding="5" cellspacing="1" width="100%" border="0" id="table7">
                                  <tr class="GenRow">
                                    <td bgcolor="#DBEAF5">
                                        <p align="left"><font face="tahoma,verdana" size="2"><b>Booking her</b></font>
                                    </td>
                                  </tr>
                                  <tr class="GenRow">
                                    <td bgcolor="#ffffff" valign="top" style="color: #000000; font-family: Tahoma,Verdana; font-size: 11px">
                                        <table border="1" width="100%" bgcolor="#FFFFFF" id="table18" style="border-collapse:collapse">
                                              <tr class="GenRow">
                                                  <td width="104" height="28" class="GenCol">Fra&nbsp;<% ShowError "Afrejse" %></td>
                                                  <td width="104" height="28" class="GenCol">Til&nbsp;<% ShowError "Ankomst" %></td>
                                                  <td width="78" height="28" class="GenCol">Flight&nbsp;<% ShowError "flightnr" %></td>
                                                  <td width="124" height="28" class="GenCol">Dato&nbsp;<% ShowError "afrejsedato" %></td>
                                                  <td width="61" height="28" class="GenCol">Depart&nbsp;<% ShowError "depart" %></td>
                                                  <td width="40" height="28" class="GenCol">Arrival</td>
                                                  <td width="45" height="28" class="GenCol">Antal </td>
                                                  <td width="55" height="28" class="GenCol">Terminal</td>
                                              </tr>
                                              <tr class="GenRow">
                                                  <td width="104" valign="top" class="GenColB">
                                                      <% ShowFra("Afrejse") %>
                                                  </td>
                                                  <td width="104" valign="top" class="GenColB">
                                                    <% ShowTil("Ankomst") %> &nbsp;</td>
                                                  <td width="78" valign="top" class="GenColB">
                                                    <% ShowFlight("flightnr") %> &nbsp;</td>
                                                  <td width="124" valign="top" class="GenColB">
                                                    <% ShowDato("afrejsedato") %> &nbsp;</td>
                                                  <td width="61" valign="top" class="GenColB">
                                                    <% ShowDepart("depart") %> &nbsp;</td>
                                                  <td width="40" valign="top" class="GenColB">
                                                      <input type="text" readonly="True" value="<% ShowArrival("arrival") %>" name="Arrival" size="5">
                                                  </td>
                                                  <td width="45" valign="top" align="right" class="GenColB">
                                                  <input type="hidden" value="<% ShowAntal %>" name="Antalfix1">
                                                      <input type="text" value="<% ShowAntal %>" onchange="checkfejl(this.form);" name="Antal_1" id="Antal1" style="width:35px;"></td>
                                                  <td width="55" valign="top" align="center" class="GenColB">
                                                      <% ShowTerminal %>&nbsp;<% ShowFlyID %></td>
                                              </tr>
                                              <tr class="GenRow">
                                                  <td width="104" valign="top" class="GenColB">
                                                    <% ShowFra("Afrejse1") %> &nbsp;</td>
                                                  <td width="104" valign="top" class="GenColB">
                                                    <% ShowTil("Ankomst1") %> &nbsp;</td>
                                                  <td valign="top" class="GenColB">
                                                    <% ShowFlight("flightnr1") %> &nbsp;</td>
                                                  <td valign="top" class="GenColB">
                                                    <% ShowDato("hjemrejsedato") %> &nbsp;</td>
                                                  <td valign="top" class="GenColB"><font size="1" face="Verdana">
                                                    <% ShowDepart("depart1") %>
                                                  &nbsp;</td>
                                                  <td valign="top" width="40" align="right" class="GenColB">
                                                    <input type="text" readonly="True" value="<% ShowArrival("arrival1") %>" name="Arrival1" size="5">
                                                  </td>
                                                  <td valign="top" width="40" align="right" class="GenColB">
                                                  <input type="hidden" value="<% ShowAntal %>" name="Antalfix2">
                                                      <input type="text" value="<% ShowAntal %>" name="Antal_2" onchange="checkfejl(this.form);" id="Antal2" style="width:35px;"></td>
                                                  <td valign="top" width="40" align="right"  class="GenColB">
                                                    <% ShowTerminal %>&nbsp;<% ShowFlyID %></td>
                                              </tr>
                                              <tr class="GenRow">
                                                  <td width="104" height="12" class="GenCol">
                                                      Antal Voksne&nbsp;<% ShowError "x_AntalVoksenSalg" %>
                                                  </td>
                                                  <td width="104" height="12" class="GenCol">
<input type="hidden" value="<%=request("x_AntalVoksenSalg")%>" name="x_AntalVoksenSalg1" onchange="checkantal(this.form);">                                                 
<select size="1" id="Voksen" name="x_AntalVoksenSalg" onchange="checkantal(this.form);checkfejl(this.form);udregn(this.form);">                   
                                                          <%
                                                          Dim aVok
                                                          For aVok = 0 to 16
                                                          %><option value="<%=aVok%>"<%
                                                          if request("x_AntalVoksenSalg") & "H" <> aVok & "H" then
                                                          response.write ""
                                                          else
                                                          response.write " Selected"
                                                          end if
                                                          %>><%=aVok%></option>
                                                          <%
                                                          next %>
                                                    </select>
                                                  </td>
                                                  <td width="78" class="GenCol">
                                                      Antal børn&nbsp;<% ShowError "x_AntalVoksenSalg" %>
                                                  </td>
                                                  <td width="124" class="GenCol">
    <input type="hidden" value="<%=request("x_AntalBarnSalg")%>" name="x_AntalBarnSalg1" onchange="checkantal(this.form);">
      <select size="1" id="Barn" name="x_AntalBarnSalg" onchange="checkantal(this.form);checkfejl(this.form);udregn(this.form);">
                                                          <% Dim aBar
                                                          For aBar = 0 to 16
                                                          %><option value="<%=aBar%>"<%
                                                          if request("x_AntalBarnSalg") & "H" <> aBar & "H" then
                                                          response.write ""
                                                          else
                                                          response.write " Selected"
                                                          end if
                                                          %>><%=aBar%></option>
                                                          <%
                                                          next %>
                                                    </select>
                                                  </td>
                                                  <td class="GenCol">
                                                      Antal Infant&nbsp;<% ShowError "x_AntalVoksenSalg" %>
                                                  </td>
                                                  <td class="GenCol">
    <input type="hidden" value="<%=request("x_AntalInfantSalg")%>" name="x_AntalInfantSalg1" onchange="">
      <select size="1" id="Infant" name="x_AntalInfantSalg" onchange="udregn(this.form);">
                                                          <% Dim aInf
                                                          For aInf = 0 to 16
                                                          %><option value="<%=aInf%>"<%
                                                          if request("x_AntalInfantSalg") & "H" <> aInf & "H" then
                                                          response.write ""
                                                          else
                                                          response.write " Selected"
                                                          end if
                                                          %>><%=aInf%></option>
                                                          <%
                                                          next %>
                                                    </select>
                                                  </td>
                                                  <td width="104" class="GenCol" colspan="2">&nbsp;</td>
                                              </tr>
                                              <tr class="GenRow">
                                                  <td width="104" class="GenCol">Billet nr.&nbsp;<% ShowError "Billetnummer" %></td>
                                                  <td width="104" class="GenCol">
                                                      <input name="Billetnummer"
                                                            value="<% ShowReturnValue("Billetnummer") %>" size="13"></font>
                                                  </td>
                                                <td width="67" class="GenCol">
                                                      Betaling&nbsp;<% ShowError "Betbetingelser" %>
                                                  </td>
                                                  <td width="189" class="GenCol" colspan="2">
                                                      <select size="1" name="Betbetingelser">
                                                            <option selected value="TKT">TKT</option>
                                                            <option value="pp">pp</option>
                                                      </select>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                                                      <input type="button" onclick="beskedpop();" name="Knappopup" value="Besked" id="popupbeskedsknap" class="submit" style="width: 90px;">
                                                      <input type="hidden" name="Besked" value="<% ShowReturnValue("Besked") %>" id="popupbesked">
                                                  </td>
                                                  <td width="40" class="GenCol">
                                                  </td>
                                                  <td width="104" class="GenColB" colspan="2"></td>
                                              </tr>
                                        </table>
                                    </td>
                                  </tr>
                            </table>
                        </td>
                    </tr>
              </table>   
              <br><br>
              <table cellpadding="0" cellspacing="0" width="450" border="0" id="table28">
                    <tr class="GenRow">
                        <td bgcolor="#4682B4" style="color: #000000; font-family: Tahoma, Verdana; font-size: 11px">
                            <table cellpadding="0" cellspacing="0" width="450" border="0" id="table28">
                                <tr style="color: #000000; font-family: Tahoma, Verdana; font-size: 11px">
                                    <td bgcolor="#4682B4" style="color: #000000; font-family: Tahoma, Verdana; font-size: 11px">
                                        <table cellpadding="5" cellspacing="1" width="100%" border="0" id="table29">
                                            <tr style="color: #000000; font-family: Tahoma, Verdana; font-size: 11px"><th bgcolor="#DBEAF5">
                                                <p align="left"><font face="tahoma, verdana" size="2">Betaling</font>
                                            </tr>
                                            <tr style="color: #000000; font-family: Tahoma, Verdana; font-size: 11px">
                                                <td bgcolor="#ffffff" valign="top" style="color: #000000; font-family: Tahoma, Verdana; font-size: 11px">
                                                    <table border="1" width="651" height="84" bgcolor="#FFFFFF" id="table30" style="border-collapse: collapse">
                                                        <tr>
                                                            <td width="92" height="27" bgcolor="#FFFFFF">
                                                                <b><font face="Verdana" size="1" color="#336699">Pris voksne </font></b>
                                                            </td>
                                                            <td width="121" height="27">
                                                                <input name="x_PrisVoksenSalg" onchange="udregn(this.form);" size="12" value="<% ShowReturnValue("x_PrisVoksenSalg") %>">
                                                            </td>
                                                            <td width="93" height="27" bgcolor="#FFFFFF">
                                                                <b><font face="Verdana" size="1" color="#336699">Pris børn</font></b>
                                                            </td>
                                                            <td width="80" height="27">
                                                                <input name="x_PrisBarnSalg" onchange="udregn(this.form);" size="11" value="<% ShowReturnValue("x_PrisBarnSalg") %>">
                                                            </td>
                                                            <td width="82" height="27" bgcolor="#FFFFFF">
                                                                <b><font face="Verdana" size="1" color="#336699">Pris Influent</font></b>
                                                            </td>
                                                            <td width="150" height="27" colspan="2">
                                                                <input name="x_PrisInfantSalg" onchange="udregn(this.form);" size="7" value="<% ShowReturnValue("x_PrisInfantSalg") %>">
                                                            </td>
                                                        </tr>
                                                        <tr>
                                                            <td width="92" height="31">
                                                                <b><font face="Verdana" size="1" color="#336699">&nbsp;Betalt beløb</font></b>
                                                            </td>
                                                            <td width="121" height="31"><font face="Verdana" size="1">
                                                                <input name="x_Depositium" onchange="udregn(this.form);" value="<% ShowReturnValue("x_Depositium") %>" size="12" maxlength="50"></font>
                                                            </td>
                                                            <td width="93" height="31">
                                                                <b><font size="1" face="Verdana" color="#336699">Betales senest</font></b>
                                                            </td>
                                                            <td width="80" height="31"><font face="Verdana" size="1">
                                                                <input name="x_Betsenest" value="<% ShowReturnValue("x_Betsenest") %>" size="11"></font>
                                                            </td>
                                                            <td width="82" height="31">
                                                                <b><font face="Verdana" size="1" color="#336699">Restbeløb</font></b>
                                                            </td>
                                                            <td width="75" height="31"><font size="1" face="Verdana">
                                                                <input name="x_restbelob" onchange="udregn(this.form);" value="<% ShowReturnValue("x_restbelob") %>" size="7"></font>
                                                            </td>
                                                            <td width="75" height="31">&nbsp;</td>
                                                        </tr>
                                                        <tr>
                                                            <td width="92" height="28">
                                                                <b><font size="1" face="Verdana" color="#336699">Købs pris</font></b>
                                                            </td>
                                                            <td width="121" height="28">
                                                                <input name="x_Totalalle" onchange="pro(this.form);" size="12" value="<% ShowReturnValue("x_Totalalle") %>">
                                                            </td>
                                                            <td width="93" height="28">
                                                                <input name="x_total" size="10" value="<% ShowReturnValue("x_total") %>">
                                                            </td>
                                                            <td width="80" height="28">
                                                                <input name="x_Profit" size="8" value="<% ShowReturnValue("x_Profit") %>">
                                                            </td>
                                                            <td width="82" height="28">
                                                                <b><font face="Verdana" size="1" color="#336699">Forsikring</font></b>
                                                            </td>
                                                            <td width="150" height="28" colspan="2">
                                                                <input name="x_forsikring" onchange="udregn(this.form);" value="<% ShowReturnValue("x_forsikring") %>" size="7">
                                                            </td>
                                                        </tr>
                                                    </table>
                                                </td>
                                            </tr>
                                        </table>
                                    </td>
                                </tr>
                            </table>
                        </td>
                    </tr>
              </table>
              <br>
              <input type="submit" value="Opret booking" onclick="java script:checkForm();" name="Action" class="submit">
              </form>
</body>
</html>
Avatar billede neoo Nybegynder
26. marts 2004 - 00:58 #6
koden er temlige lang, håber ikke at jeg har skræmt jer væk, for har hårdt brug for hjælppp
Avatar billede tubber Juniormester
26. marts 2004 - 01:36 #7
Er det din egen IIS den kører på ?
Avatar billede tubber Juniormester
26. marts 2004 - 01:42 #8
Den er lidt tricky.......

For i bund og grund kan din sagtens være rigtig....
Og det har ikke noget med databasen at gøre, men mere den måde APS håndtere den connection, så når alt kommer til (efter hvad jeg har fundet) så er det fordi din kode ikke er optimeret til serveren......

Her er hvad jeg fandt:

this is my solution I have discovered:

ASP is full of bugs, as I discovered lately, but these bugs can be solved by writing code.

My problem was due to Database connections, it seem to me I was doing the perfect thing, opening connections, recordsets, executing queries and finally I destroy every object I create.

THE PROBLEM
===========
If you open only one connection (as I used to do), and run more than one query or recordsets at the same time, what is happening? ASP does not allow you to run more than one query through the same connection at the same time, (though it seems that it is working) so how come? Since ASP does not allow that, it creates its own connections to run the further queries you are executing, and after you are done with them, ASP is not destroying the connections it creates. If you are not destroying your connection objects as well, so you are helping the problem to come up.

WHAT IS HAPPENING
==================
unclosed objects will create a resource leak in memory, and as the times goes, more objects are not closed, and more memory resources are consumed until it reaches to the maximum. And guess what, the famous message will show up! :rolleyes:

SOLUTION
=========
-Define a connection for every query by its own.
-Create you connection object and destroy them your self, don't let ASP do any thing by its self. :D
Avatar billede tubber Juniormester
26. marts 2004 - 02:04 #9
Du kan også prøve at læse denne tråd......

Som jeg forstår det er det fordi din side er komplex og laver for mange forespørgelser til databasen......

Som der bliver nævnt i den tråd så måske et skift til mySQL......

http://netcoders.dk/forum.asp?mode=show_message&tech_id=1&forum_id=3&message_id=67008
Avatar billede neeo Nybegynder
29. marts 2004 - 02:05 #10
tubber hvordan kan jeg optimere det overnævnte kode til serveren ?
Avatar billede neeo Nybegynder
11. maj 2006 - 10:20 #11
Lukker....
Avatar billede neeo Nybegynder
11. maj 2006 - 10:20 #12
Lukker....
Avatar billede Ny bruger Nybegynder

Din løsning...

Tilladte BB-code-tags: [b]fed[/b] [i]kursiv[/i] [u]understreget[/u] Web- og emailadresser omdannes automatisk til links. Der sættes "nofollow" på alle links.

Loading billede Opret Preview
Kategori
Kurser inden for grundlæggende programmering

Log ind eller opret profil

Hov!

For at kunne deltage på Computerworld Eksperten skal du være logget ind.

Det er heldigvis nemt at oprette en bruger: Det tager to minutter og du kan vælge at bruge enten e-mail, Facebook eller Google som login.

Du kan også logge ind via nedenstående tjenester