some advice please

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Bob

    some advice please

    Hallo,

    I have to make a web application in Javascript/ASP for tenniscourt
    reservation (based on Access database). I would like to do everything with
    one page, because the user must be able to change his day, hour or
    tenniscourt choice before really reserving it . I tried like this:

    The first SELECT contains the date (next 30 days) and is filled dynamically.
    No problem.
    When the date is chosen (by clicking), the second SELECT must appears with
    the right opening hours (monday = 8 -18h, friday=8-16h etc ..). So i need a
    query like "select mondayhour, tuesdayhour ... from daytable". This is no
    problem because the code can be placed between <% %> just below the
    first SELECT (set objdc = Server.CreateOb ject("ADODB.Con nection" etc ..). No
    form needed because no variable to pass to ASP.

    My problem is when several tests must be done which require passing
    variables to ASP.
    Imagine that you can only reserve 2hours in a day. I need a query "select
    count(hour) as tothour from reservation where day='" & dat & "' group by
    logon having logon='" & login & "'" to check it. So i have to pass 'dat'
    (chosen date) and 'login' (name of user) to ASP via a form that i submit to
    this ASP file. The value of tothour can be returned by <%=tothour%> to the
    client script.
    Imagine you can maximum reserve 15 h in 30 days. Again a query "select
    logon, count(hour) as tothour2 from reservation where cdate(day)> date()
    group by logon having logon='" & login & "'" . Again a form to pass 'logon'
    and submit it to itself

    If tothour <2, then the third SELECT must appear with the tenniscourt
    numbers which are still available. I need another query like "select
    tennisnr from reservation where cdate(day)='" & dat & "' and hour=" & hr
    (hr=chosen hour). I need to pass "dat" and 'hr" to ASP. So i submit another
    form to ASP.
    Etc ...

    Is this way the right way to work? Does this not become very complicated and
    confusing, also because when submitting the second form, the variable
    passing through the first form are lost.

    Thanks for any advice.
    Bob


  • Jeff Cochran

    #2
    Re: some advice please

    On Fri, 2 Jul 2004 19:07:21 +0200, "Bob" <sdssd@no.az> wrote:

    You're putting the business logic on the client side of the app when
    you do this. There's nothing wrong with that, but as you've seen,
    you're doing multiple queries of the database, then posting back to
    the same form. Some of this could be encoded in the page logic, such
    as which hours the courts are open on which days, or you could do an
    initial select for all hours for the next 30 days and then display
    them as available/unavailable in a DHTML page where you unhide
    elements as others are selected (check a client side or DHTML group
    for sample code here).

    In essence though, you're doing a scheduling application. Take a look
    at scheduling apps available on the web and see if they will fit your
    needs, or what ideas they generate in your application. Aspin.com
    would make a decent starting place.

    Jeff

    [color=blue]
    >I have to make a web application in Javascript/ASP for tenniscourt
    >reservation (based on Access database). I would like to do everything with
    >one page, because the user must be able to change his day, hour or
    >tenniscourt choice before really reserving it . I tried like this:
    >
    >The first SELECT contains the date (next 30 days) and is filled dynamically.
    >No problem.
    >When the date is chosen (by clicking), the second SELECT must appears with
    >the right opening hours (monday = 8 -18h, friday=8-16h etc ..). So i need a
    >query like "select mondayhour, tuesdayhour ... from daytable". This is no
    >problem because the code can be placed between <% %> just below the
    >first SELECT (set objdc = Server.CreateOb ject("ADODB.Con nection" etc ..). No
    >form needed because no variable to pass to ASP.
    >
    >My problem is when several tests must be done which require passing
    >variables to ASP.
    >Imagine that you can only reserve 2hours in a day. I need a query "select
    >count(hour) as tothour from reservation where day='" & dat & "' group by
    >logon having logon='" & login & "'" to check it. So i have to pass 'dat'
    >(chosen date) and 'login' (name of user) to ASP via a form that i submit to
    >this ASP file. The value of tothour can be returned by <%=tothour%> to the
    >client script.
    >Imagine you can maximum reserve 15 h in 30 days. Again a query "select
    >logon, count(hour) as tothour2 from reservation where cdate(day)> date()
    >group by logon having logon='" & login & "'" . Again a form to pass 'logon'
    >and submit it to itself
    >
    >If tothour <2, then the third SELECT must appear with the tenniscourt
    >numbers which are still available. I need another query like "select
    >tennisnr from reservation where cdate(day)='" & dat & "' and hour=" & hr
    >(hr=chosen hour). I need to pass "dat" and 'hr" to ASP. So i submit another
    >form to ASP.
    >Etc ...
    >
    >Is this way the right way to work? Does this not become very complicated and
    >confusing, also because when submitting the second form, the variable
    >passing through the first form are lost.
    >
    >Thanks for any advice.
    >Bob
    >[/color]

    Comment

    • Bob

      #3
      Re: some advice please

      Thanks

      "Jeff Cochran" <jeff.nospam@zi na.com> wrote in message
      news:40e5bd78.6 29952824@msnews .microsoft.com. ..[color=blue]
      > On Fri, 2 Jul 2004 19:07:21 +0200, "Bob" <sdssd@no.az> wrote:
      >
      > You're putting the business logic on the client side of the app when
      > you do this. There's nothing wrong with that, but as you've seen,
      > you're doing multiple queries of the database, then posting back to
      > the same form. Some of this could be encoded in the page logic, such
      > as which hours the courts are open on which days, or you could do an
      > initial select for all hours for the next 30 days and then display
      > them as available/unavailable in a DHTML page where you unhide
      > elements as others are selected (check a client side or DHTML group
      > for sample code here).
      >
      > In essence though, you're doing a scheduling application. Take a look
      > at scheduling apps available on the web and see if they will fit your
      > needs, or what ideas they generate in your application. Aspin.com
      > would make a decent starting place.
      >
      > Jeff
      >
      >[color=green]
      > >I have to make a web application in Javascript/ASP for tenniscourt
      > >reservation (based on Access database). I would like to do everything[/color][/color]
      with[color=blue][color=green]
      > >one page, because the user must be able to change his day, hour or
      > >tenniscourt choice before really reserving it . I tried like this:
      > >
      > >The first SELECT contains the date (next 30 days) and is filled[/color][/color]
      dynamically.[color=blue][color=green]
      > >No problem.
      > >When the date is chosen (by clicking), the second SELECT must appears[/color][/color]
      with[color=blue][color=green]
      > >the right opening hours (monday = 8 -18h, friday=8-16h etc ..). So i need[/color][/color]
      a[color=blue][color=green]
      > >query like "select mondayhour, tuesdayhour ... from daytable". This is[/color][/color]
      no[color=blue][color=green]
      > >problem because the code can be placed between <% %> just below the
      > >first SELECT (set objdc = Server.CreateOb ject("ADODB.Con nection" etc ..).[/color][/color]
      No[color=blue][color=green]
      > >form needed because no variable to pass to ASP.
      > >
      > >My problem is when several tests must be done which require passing
      > >variables to ASP.
      > >Imagine that you can only reserve 2hours in a day. I need a query "select
      > >count(hour) as tothour from reservation where day='" & dat & "' group by
      > >logon having logon='" & login & "'" to check it. So i have to pass 'dat'
      > >(chosen date) and 'login' (name of user) to ASP via a form that i submit[/color][/color]
      to[color=blue][color=green]
      > >this ASP file. The value of tothour can be returned by <%=tothour%> to[/color][/color]
      the[color=blue][color=green]
      > >client script.
      > >Imagine you can maximum reserve 15 h in 30 days. Again a query "select
      > >logon, count(hour) as tothour2 from reservation where cdate(day)> date()
      > >group by logon having logon='" & login & "'" . Again a form to pass[/color][/color]
      'logon'[color=blue][color=green]
      > >and submit it to itself
      > >
      > >If tothour <2, then the third SELECT must appear with the tenniscourt
      > >numbers which are still available. I need another query like "select
      > >tennisnr from reservation where cdate(day)='" & dat & "' and hour=" & hr
      > >(hr=chosen hour). I need to pass "dat" and 'hr" to ASP. So i submit[/color][/color]
      another[color=blue][color=green]
      > >form to ASP.
      > >Etc ...
      > >
      > >Is this way the right way to work? Does this not become very complicated[/color][/color]
      and[color=blue][color=green]
      > >confusing, also because when submitting the second form, the variable
      > >passing through the first form are lost.
      > >
      > >Thanks for any advice.
      > >Bob
      > >[/color]
      >[/color]


      Comment

      • Bob

        #4
        Re: some advice please

        I read something about RDS, where it's possible to access database from VB.
        Is this a good idea?
        Bob
        "Jeff Cochran" <jeff.nospam@zi na.com> wrote in message
        news:40e5bd78.6 29952824@msnews .microsoft.com. ..[color=blue]
        > On Fri, 2 Jul 2004 19:07:21 +0200, "Bob" <sdssd@no.az> wrote:
        >
        > You're putting the business logic on the client side of the app when
        > you do this. There's nothing wrong with that, but as you've seen,
        > you're doing multiple queries of the database, then posting back to
        > the same form. Some of this could be encoded in the page logic, such
        > as which hours the courts are open on which days, or you could do an
        > initial select for all hours for the next 30 days and then display
        > them as available/unavailable in a DHTML page where you unhide
        > elements as others are selected (check a client side or DHTML group
        > for sample code here).
        >
        > In essence though, you're doing a scheduling application. Take a look
        > at scheduling apps available on the web and see if they will fit your
        > needs, or what ideas they generate in your application. Aspin.com
        > would make a decent starting place.
        >
        > Jeff
        >
        >[color=green]
        > >I have to make a web application in Javascript/ASP for tenniscourt
        > >reservation (based on Access database). I would like to do everything[/color][/color]
        with[color=blue][color=green]
        > >one page, because the user must be able to change his day, hour or
        > >tenniscourt choice before really reserving it . I tried like this:
        > >
        > >The first SELECT contains the date (next 30 days) and is filled[/color][/color]
        dynamically.[color=blue][color=green]
        > >No problem.
        > >When the date is chosen (by clicking), the second SELECT must appears[/color][/color]
        with[color=blue][color=green]
        > >the right opening hours (monday = 8 -18h, friday=8-16h etc ..). So i need[/color][/color]
        a[color=blue][color=green]
        > >query like "select mondayhour, tuesdayhour ... from daytable". This is[/color][/color]
        no[color=blue][color=green]
        > >problem because the code can be placed between <% %> just below the
        > >first SELECT (set objdc = Server.CreateOb ject("ADODB.Con nection" etc ..).[/color][/color]
        No[color=blue][color=green]
        > >form needed because no variable to pass to ASP.
        > >
        > >My problem is when several tests must be done which require passing
        > >variables to ASP.
        > >Imagine that you can only reserve 2hours in a day. I need a query "select
        > >count(hour) as tothour from reservation where day='" & dat & "' group by
        > >logon having logon='" & login & "'" to check it. So i have to pass 'dat'
        > >(chosen date) and 'login' (name of user) to ASP via a form that i submit[/color][/color]
        to[color=blue][color=green]
        > >this ASP file. The value of tothour can be returned by <%=tothour%> to[/color][/color]
        the[color=blue][color=green]
        > >client script.
        > >Imagine you can maximum reserve 15 h in 30 days. Again a query "select
        > >logon, count(hour) as tothour2 from reservation where cdate(day)> date()
        > >group by logon having logon='" & login & "'" . Again a form to pass[/color][/color]
        'logon'[color=blue][color=green]
        > >and submit it to itself
        > >
        > >If tothour <2, then the third SELECT must appear with the tenniscourt
        > >numbers which are still available. I need another query like "select
        > >tennisnr from reservation where cdate(day)='" & dat & "' and hour=" & hr
        > >(hr=chosen hour). I need to pass "dat" and 'hr" to ASP. So i submit[/color][/color]
        another[color=blue][color=green]
        > >form to ASP.
        > >Etc ...
        > >
        > >Is this way the right way to work? Does this not become very complicated[/color][/color]
        and[color=blue][color=green]
        > >confusing, also because when submitting the second form, the variable
        > >passing through the first form are lost.
        > >
        > >Thanks for any advice.
        > >Bob
        > >[/color]
        >[/color]


        Comment

        • Jeff Cochran

          #5
          Re: some advice please

          On Sat, 3 Jul 2004 10:38:15 +0200, "Bob" <sdssd@no.az> wrote:
          [color=blue]
          >I read something about RDS, where it's possible to access database from VB.
          >Is this a good idea?[/color]

          Only you can determine if it's good in your situation. It's not ASP
          so you may want to try a VB group for advice.

          Jeff
          [color=blue]
          >Bob
          >"Jeff Cochran" <jeff.nospam@zi na.com> wrote in message
          >news:40e5bd78. 629952824@msnew s.microsoft.com ...[color=green]
          >> On Fri, 2 Jul 2004 19:07:21 +0200, "Bob" <sdssd@no.az> wrote:
          >>
          >> You're putting the business logic on the client side of the app when
          >> you do this. There's nothing wrong with that, but as you've seen,
          >> you're doing multiple queries of the database, then posting back to
          >> the same form. Some of this could be encoded in the page logic, such
          >> as which hours the courts are open on which days, or you could do an
          >> initial select for all hours for the next 30 days and then display
          >> them as available/unavailable in a DHTML page where you unhide
          >> elements as others are selected (check a client side or DHTML group
          >> for sample code here).
          >>
          >> In essence though, you're doing a scheduling application. Take a look
          >> at scheduling apps available on the web and see if they will fit your
          >> needs, or what ideas they generate in your application. Aspin.com
          >> would make a decent starting place.
          >>
          >> Jeff
          >>
          >>[color=darkred]
          >> >I have to make a web application in Javascript/ASP for tenniscourt
          >> >reservation (based on Access database). I would like to do everything[/color][/color]
          >with[color=green][color=darkred]
          >> >one page, because the user must be able to change his day, hour or
          >> >tenniscourt choice before really reserving it . I tried like this:
          >> >
          >> >The first SELECT contains the date (next 30 days) and is filled[/color][/color]
          >dynamically.[color=green][color=darkred]
          >> >No problem.
          >> >When the date is chosen (by clicking), the second SELECT must appears[/color][/color]
          >with[color=green][color=darkred]
          >> >the right opening hours (monday = 8 -18h, friday=8-16h etc ..). So i need[/color][/color]
          >a[color=green][color=darkred]
          >> >query like "select mondayhour, tuesdayhour ... from daytable". This is[/color][/color]
          >no[color=green][color=darkred]
          >> >problem because the code can be placed between <% %> just below the
          >> >first SELECT (set objdc = Server.CreateOb ject("ADODB.Con nection" etc ..).[/color][/color]
          >No[color=green][color=darkred]
          >> >form needed because no variable to pass to ASP.
          >> >
          >> >My problem is when several tests must be done which require passing
          >> >variables to ASP.
          >> >Imagine that you can only reserve 2hours in a day. I need a query "select
          >> >count(hour) as tothour from reservation where day='" & dat & "' group by
          >> >logon having logon='" & login & "'" to check it. So i have to pass 'dat'
          >> >(chosen date) and 'login' (name of user) to ASP via a form that i submit[/color][/color]
          >to[color=green][color=darkred]
          >> >this ASP file. The value of tothour can be returned by <%=tothour%> to[/color][/color]
          >the[color=green][color=darkred]
          >> >client script.
          >> >Imagine you can maximum reserve 15 h in 30 days. Again a query "select
          >> >logon, count(hour) as tothour2 from reservation where cdate(day)> date()
          >> >group by logon having logon='" & login & "'" . Again a form to pass[/color][/color]
          >'logon'[color=green][color=darkred]
          >> >and submit it to itself
          >> >
          >> >If tothour <2, then the third SELECT must appear with the tenniscourt
          >> >numbers which are still available. I need another query like "select
          >> >tennisnr from reservation where cdate(day)='" & dat & "' and hour=" & hr
          >> >(hr=chosen hour). I need to pass "dat" and 'hr" to ASP. So i submit[/color][/color]
          >another[color=green][color=darkred]
          >> >form to ASP.
          >> >Etc ...
          >> >
          >> >Is this way the right way to work? Does this not become very complicated[/color][/color]
          >and[color=green][color=darkred]
          >> >confusing, also because when submitting the second form, the variable
          >> >passing through the first form are lost.
          >> >
          >> >Thanks for any advice.
          >> >Bob
          >> >[/color]
          >>[/color]
          >[/color]

          Comment

          Working...