create a dynamic web page with DB interaction

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Aashish Washikar
    New Member
    • Nov 2007
    • 4

    create a dynamic web page with DB interaction

    Hi guys,
    I'm trying to develop a front end tool using Macromedia Dream weaver and MS Access with the help os ASP.
    My condition is once a value is selected frlom the drop down menu, it should pull all the records related to that value from the mdb file, and it should have three check boxes along side the value.
    These check boxes which when checked the answer should be saved in the database.

    Expecting an answer.

    Thanks
    Aashish Washikar
  • omerbutt
    Contributor
    • Nov 2006
    • 638

    #2
    Originally posted by Aashish Washikar
    Hi guys,
    I'm trying to develop a front end tool using Macromedia Dream weaver and MS Access with the help os ASP.
    My condition is once a value is selected frlom the drop down menu, it should pull all the records related to that value from the mdb file, and it should have three check boxes along side the value.
    These check boxes which when checked the answer should be saved in the database.

    Expecting an answer.

    Thanks
    Aashish Washikar
    can u show some of the code u have written till now so i can guide u in the proper way :),,u have to be lil discriptive while u ask a question......; )

    Comment

    • jhardman
      Recognized Expert Specialist
      • Jan 2007
      • 3405

      #3
      Originally posted by Aashish Washikar
      Expecting an answer.

      Thanks
      Aashish Washikar
      42

      Jared

      Comment

      • Aashish Washikar
        New Member
        • Nov 2007
        • 4

        #4
        Hi Omer,
        I'm a complete newbie to the subject, so if u can suggest me how to do it from scratch. It would be great.

        Thanks in advance

        Comment

        • omerbutt
          Contributor
          • Nov 2006
          • 638

          #5
          well i should tell you first that you should have a very gud know how with the following things asp,msaccess,ht ml and javascript i would suggest youu to use html for your front end and asp at the back end for cummunitcating with the database use dreamweaver ver 8.+.....and as per your requirementyou are trying to make a drop down box okay .....means you have to use
          [HTML]
          <select >
          <option1></option>
          <option1></option>
          </select>
          [/HTML]
          and then make as much select drop down lists as many items you have in the first select menu for example i can give you an idea

          i have a db in access which has a table named Stock
          which has the record of printers of these 3 main companies
          "konica,hp,cann on" which are denoted by the field name of company lets say

          TABLE:Stock
          Field name----------Type-------------------------------------Example data
          id_no (primary key,Autonumber) automatically assigned
          macmodel (text) 2200,200,KM5410
          company (text) HP,CANON,KONICA

          NOW MAKE A FORM IN HTML AND MAKE A SELECTION MENU
          Code:
          <select name="company">
          <option value="none" selected="selected">Please Select a Company</option>
          <option value="H">HP</option>
          <option value="K">KONICA</option>
          <option value="C">CANON</option>
          </select>
          now make the recordset object and connection string
          Code:
          <%
          set rs=Sever.CreateObject("ADODB.recordset")
          connstr="Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" & Server.MapPath("PATH TO YOU DATABSE")
          %>
          Now run a query to select all MachineModels for HP
          Code:
          <%
          STRsql="Select * FROM stock WHERE stock.company='HP';"
          %>
          now open the query and connection string with the recset object
          Code:
          <%
          rs.Open strSQL, connstr,3
          %>
          here you can display all the items for the hp models in a drop down list
          Code:
          <select name="HP">
          <%while not rs.EOF%>//////////////loop until the end of file 
          <option value="<%=rs.fields("macmodel")%>">response.write(rs.fields("macmodel"))</option>
          <%rs.Movenext  //////////////move to next item inthe database
                loop
                rs.close
          %>
          </select>
          did you got any idea .........i am stopping here if you want continious guidence ........you have to work by your self too ..........now do a work make a form as i told you and a database containing the same fields name as i told you
          make some entries manuallly by opening the database in access and enter 3 records for each of the companies having any kind of model names as you like and make a form and make all the four selection menus there as i told you

          1...for the compnies
          2....for the hp models (by looping through the database)
          3....for canon models (same as above by looping)
          4...for the konica (same as above)

          then return to me with your code "properly running"...then i will tell you how to hide them and how to trigger them open when they are required
          Reagards,
          Omer

          Originally posted by Aashish Washikar
          Hi Omer,
          I'm a complete newbie to the subject, so if u can suggest me how to do it from scratch. It would be great.

          Thanks in advance
          Last edited by jhardman; Dec 4 '07, 12:25 AM. Reason: fixed a code tag

          Comment

          • Aashish Washikar
            New Member
            • Nov 2007
            • 4

            #6
            Hi,
            I'm sorry for being away for quite a some time now.

            Here is what i wrote.

            The error :
            Microsoft VBScript runtime error '800a01a8'

            Object required: ''

            /helpdesk/geae/Washikar/Test/saveg.asp, line 5

            The code :


            [code=asp]<%
            Dim Conn
            Dim Rs
            Dim sql
            Rs.source = "Eboard"
            objrs.activecon nection = objconn
            objrs.open

            'Create an ADO connection and recordset object
            Set Conn = Server.CreateOb ject("ADODB.Con nection")
            Set Rs = Server.CreateOb ject("ADODB.Rec ordset")

            'Set an active connection and select fields from the database
            Cn.Open "DRIVER={Micros oft Access Driver (*.mdb)}; DBQ=" & Server.MapPath( ".\Eboard.m db")

            sql= "SELECT Time, Employee Name, Lean, Six Sigma, Green Belt FROM Eboard;"

            'Set the lock and cursor type
            Rs.CursorType = adOpenForwardOn ly
            Rs.LockType = 3

            Rs.Open sql, ObjConn 'Open the recordset with sql query

            Rs.AddNew 'Prepare the database to add a new record and add
            Rs.Fields("Time ") = Request("Time")
            Rs.Fields("Empl oyee Name") = Request("Employ ee Name")
            Rs.Fields("Lean ") = Request("Lean")
            Rs.Fields("Six Sigma")=Request ("Six Sigma")
            Rs.Fields("Gree n Belt") = Request("Green Belt")

            Rs.Update 'Save the update
            Rs.Close
            Set Rs = Nothing
            Set Conn = Nothing
            Response.Redire ct "index.htm"
            %>[/code]
            Last edited by jhardman; Dec 30 '07, 10:52 PM. Reason: put code in code tags. Please notice button marked - #

            Comment

            • Aashish Washikar
              New Member
              • Nov 2007
              • 4

              #7
              [code=asp]<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
              <%@ Language=VBScri pt %>
              <%option explicit%>
              <%Response.Buff er = false%>
              <html>
              <head>
              <title>Employee s Reporting to Mr. Balaji Subramaniam</title>
              <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
              <SCRIPT type=text/javascript>
              var timer = null
              function start()
              {
              var months = new Array(13);
              months[0] = "1";
              months[1] = "2";
              months[2] = "3";
              months[3] = "4";
              months[4] = "5";
              months[5] = "6";
              months[6] = "7";
              months[7] = "8";
              months[8] = "9";
              months[9] = "10";
              months[10] = "11";
              months[11] = "12";
              var time = new Date()
              var monthnumber = time.getMonth() ;
              var monthname = months[monthnumber];
              var monthday = time.getDate();
              var year = time.getYear();
              var hours = time.getHours()
              var minutes = time.getMinutes ()

              if(year < 2000) { year = year + 1900; }
              var dateString = monthname +
              '/' +
              monthday +
              '/' +
              year;

              minutes=((minut es < 10) ? "0" : "") + minutes
              var seconds = time.getSeconds ()
              seconds=((secon ds < 10) ? "0" : "") + seconds
              var clock = hours + ":" + minutes + ":" + seconds
              document.forms[0].time.value = dateString + " " + clock
              timer = setTimeout("sta rt()",1000)
              }
              </SCRIPT>
              <META content="MSHTML 6.00.2800.1601" name=GENERATOR> </HEAD>
              <BODY onload=start()> <FONT face="Times New Roman" color=red>

              </head>




              <body>
              <FORM action=./saveg.asp method=post>
              <table width="100%" border="0">
              <tr>
              <td width="22%" align="left" valign="top"><i mg src="file:///L|/Washikar/Get%20it/629904.jpg" width="167" height="74"></td>
              <td width="78%"> <h1 align="left"><s trong>IT Services</strong><br>
              Lean Tracker</h1>
              <p>&nbsp;</p></td>
              </tr>



              <tr>
              <td height="23" colspan="2"> <hr> </td>
              </tr>




              <tr>
              <td>&nbsp;
              <TR>
              <TD><B>Time of Entry</B>
              <TD><INPUT size=18 name=time> <BR></TD>
              <TR>
              <td><strong>Sup ervisor Name </strong>
              <td valign="middle" ><div align="left">Mr . Balaji Subramaniam<br>
              </div></td>
              </tr>

              </table>




              <p>&nbsp;</p><table width="100%" border="0">
              <tr>
              <td><strong>S l. No</strong></td>
              <td><strong>Emp loyee OHR<br>
              </strong></td>
              <td><strong>Emp loyee Name<br>
              </strong></td>
              <td><div align="center"> <strong>Lean <br>
              </strong></div></td>
              <td><div align="center"> <strong>SixSigm a<br>
              </strong></div></td>
              <td><div align="center"> <strong>Green Belt<br>
              </strong></div></td>
              </tr>




              <tr>
              <td>1.</td>
              <td>703000133<b r></td>
              <td>Pramod Sonduripanthang i<br></td>
              <td>
              <FORM action=./saveg.asp method=post>
              <div align="center">

              <input type="checkbox" name="Options" value="Lean">
              </div>
              </form></td>
              <td><FORM action=./saveg.asp method=post>
              <div align="center">

              <input type="checkbox" name="Options" value="SixSigma ">
              </div>
              </form></td>
              <td><form name="form3" method="post" action="saveg.a sp">
              <div align="center">
              <input type="checkbox" name="Green Belt" value="checkbox ">
              </div>
              </form></td>
              </tr>







              <tr>
              <td>2.</td>
              <td>303015604<b r></td>
              <td>Abdul Shaik Auqil<br></td>
              <td><form name="form4" method="post" action="saveg.a sp">
              <div align="center">
              <input type="checkbox" name="Lean" value="checkbox ">
              </div>
              </form></td>
              <td><form name="form5" method="post" action="saveg.a sp">
              <div align="center">
              <input type="checkbox" name="SixSigma" value="checkbox ">
              </div>
              </form></td>
              <td><form name="form6" method="post" action="saveg.a sp">
              <div align="center">
              <input type="checkbox" name="Green Belt" value="checkbox ">
              </div>
              </form></td>
              </tr>




              <tr>

              <td class="bodyblac k">&nbsp;</td>
              </tr>
              <tr>
              <td class="hgt">
              </td>
              </tr>
              <tr>
              <td class="bodyblac k">

              </td>
              </tr>
              <tr>
              <td class="hgt" >
              </td>
              </tr>
              <tr>
              <td class="hgt" >
              </td>
              </tr>
              <tr>
              <td align="right" class="bodyblac k" >
              </td>
              </tr></tbody>
              </table> </td> </tr> </table> </td> </tr> <table width="100%" border="0"> </td>
              <td>&nbsp;</td>
              </tr>

              </table>
              <p>&nbsp;</p><table width="100%" border="0">
              <tr>
              <td><form name="form10" method="post" action="saveg.a sp">
              <div align="center">
              <input type="submit" name="Submit" value="Submit">
              </div>
              </form></td>
              </tr>
              </table>
              <p>&nbsp;</p>
              <tr>

              <td align="left" class="bodyblac k">&nbsp; </td>
              </tr>
              <tr>
              <td class="hgt">
              </td>
              </tr>

              <tr>

              <td class="bodyblac k">&nbsp;</td>
              </tr>
              <tr>
              <td class="hgt">
              </td>
              </tr>
              <tr>
              <td class="bodyblac k">

              </td>
              </tr>
              <tr>
              <td class="hgt" >
              </td>
              </tr>
              <tr>
              <td class="hgt" >
              </td>
              </tr>
              <tr>
              <td align="right" class="bodyblac k" >
              </td>
              </tr></tbody>
              </table> </td> </tr> </table> </td> </tr> <table width="100%" border="0"> </td>
              <td>&nbsp;</td>
              </tr>
              <tr>
              <td valign="middle" >&nbsp;</td>
              <td>&nbsp;</td>
              <td>&nbsp;</td>
              <td>&nbsp;</td>
              <td>&nbsp;</td>
              </tr>
              </body>
              </html>[/code]
              Last edited by jhardman; Dec 30 '07, 10:53 PM. Reason: put code in code tags. Please notice button marked - #

              Comment

              Working...