Access database and web pages , nubie problem!

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

    Access database and web pages , nubie problem!

    Hi to all.
    I am pretty new to using Access and am having a problem I hope someone
    can help me with.
    I want to access a MS-Access database from a web page. I have managed
    to get it "sort" of working using MS-Access's 'data access page'
    function as it were.
    This creates a web page that is linked to a database table. The
    problem that
    I have is that if data in the dbase is changed, it does not
    immediately reflect
    on the web page , you have to refresh the web page.
    I don't have any sort of web site that this web page is on , I just
    want to
    run it of my machine at the moment. i.e double click on
    c:\mywebpage.ht ml and view the database.The dbase is also on the
    machine. C:\mydbase.mdb
    I found an article ' Creating dynamic web pages using Ms-access' , or
    something like that , on the net , but I just can't seem to get this
    thing working.
    Any help would be appreciated.
    Cheers
    Rob
    email: seegoon99NOSPAM @yahoo.com
  • Edward

    #2
    Re: Access database and web pages , nubie problem!

    seegoon99@yahoo .com (rob) wrote in message news:<890c3e4d. 0311172212.1961 2a22@posting.go ogle.com>...[color=blue]
    > Hi to all.
    > I am pretty new to using Access and am having a problem I hope someone
    > can help me with.
    > I want to access a MS-Access database from a web page. I have managed
    > to get it "sort" of working using MS-Access's 'data access page'
    > function as it were.
    > This creates a web page that is linked to a database table. The
    > problem that
    > I have is that if data in the dbase is changed, it does not
    > immediately reflect
    > on the web page , you have to refresh the web page.
    > I don't have any sort of web site that this web page is on , I just
    > want to
    > run it of my machine at the moment. i.e double click on
    > c:\mywebpage.ht ml and view the database.The dbase is also on the
    > machine. C:\mydbase.mdb
    > I found an article ' Creating dynamic web pages using Ms-access' , or
    > something like that , on the net , but I just can't seem to get this
    > thing working.
    > Any help would be appreciated.
    > Cheers
    > Rob
    > email: seegoon99NOSPAM @yahoo.com[/color]

    You need to understand that web pages are normally stateless. If the
    data changes underneath, and you need this reflected at once on the
    web page, but you don't want the user constantly pressing F5 or
    whatever, then you will need to push this.

    Edward
    --
    The reading group's reading group:

    Comment

    • pjac

      #3
      Re: Access database and web pages , nubie problem!

      You need some HTML links on your webpage to sort the columns. You
      didn't indicate what kind of dynamic code you're using: such as .ASP
      or .CFM (Cold Fusion), so I'll assume it's ASP. Try this HTML code
      example below your delarative (dim) statements that define the source
      of your database:



      <If #How# is "None">
      Order By ID
      ELSEIF #HOW# is "Name">
      Order by Last_Name
      ELSEIF #HOW# is "Organizati on">
      Order by Organization
      </if>



      <A href="yourwebpa ge.asp?"how=Nam e"> NAME </a> <!--remark name
      link-->
      <A href="yourwebpa ge.asp?"how=ID" > NAME </a> <!--ID name link-->
      <A href="yourwebpa ge.asp?"how=Org anization">Orga nization</a>
      <!--remark organization link-->

      After adding this code, you can also make a hyperlink at the bottom of
      you webpage that will automatically sort by last name whenever it is
      clicked.

      <A href="http://www.yourwebpage .asp>how=name'</a>


      Good Luck!!!
      pjac

      Comment

      • Steve

        #4
        Re: Access database and web pages , nubie problem!

        Pjac,

        Can you answer these questions for me ---

        How do you set up a webpage where the user must enter a password to access?

        How do you then capture the user's name?

        How do you set up about six fields for the user to fill in?

        How do you get the data in the six fields back to Access?

        Can the above be done with a data access page? How?

        Thanks for any help you can give me!

        Steve


        "pjac" <pjac@erols.com > wrote in message
        news:9435ccd8.0 311180553.39754 af5@posting.goo gle.com...[color=blue]
        > You need some HTML links on your webpage to sort the columns. You
        > didn't indicate what kind of dynamic code you're using: such as .ASP
        > or .CFM (Cold Fusion), so I'll assume it's ASP. Try this HTML code
        > example below your delarative (dim) statements that define the source
        > of your database:
        >
        >
        >
        > <If #How# is "None">
        > Order By ID
        > ELSEIF #HOW# is "Name">
        > Order by Last_Name
        > ELSEIF #HOW# is "Organizati on">
        > Order by Organization
        > </if>
        >
        >
        >
        > <A href="yourwebpa ge.asp?"how=Nam e"> NAME </a> <!--remark name
        > link-->
        > <A href="yourwebpa ge.asp?"how=ID" > NAME </a> <!--ID name link-->
        > <A href="yourwebpa ge.asp?"how=Org anization">Orga nization</a>
        > <!--remark organization link-->
        >
        > After adding this code, you can also make a hyperlink at the bottom of
        > you webpage that will automatically sort by last name whenever it is
        > clicked.
        >
        > <A href="http://www.yourwebpage .asp>how=name'</a>
        >
        >
        > Good Luck!!!
        > pjac[/color]


        Comment

        • pjac

          #5
          Re: Access database and web pages , nubie problem!

          I suggest that you acquire a Front Page Bible and a HTML book from the
          library. It explains everything very well and is easy to use. To
          create a dynamic HTML webpage that retrieves data from the database as
          opposed to a static data access page, you need the following items:

          OBDC connection--DSN (go to Start button on your Windows taskbar, to
          the Control Panel, ODBC icon. Set up your DSN (datasource) where the
          database is located.)

          MS-Access Database (2 tables: Accounts,Access Log....)

          2 webpages (login.asp) and (mainpage.html)

          Web Browser (Internet Explorer)

          Web Editor (front Page, Word, cold fusion, etc..)

          Create a login form in MS-Access that has all the necesary fields
          (firstName, lastname, address, etc...), In the menu go to FILE, Save
          as Dynamic HTML (follow the prompts). Open the saved webpage in a Web
          Editor so that you can see the HTML code. See example below for code.
          The textboxes on your login form must have the same names, such as
          myUserid, mypassword,last name....These pass the values typed into the
          webpage back to through the ODBC connection to the database.The user
          gets an error message if nothing matches the database. It goes to the
          next page (mainpage.html) that you have created to say thank you it
          the match is correct.
          [color=blue]
          > How do you set up a webpage where the user must enter a password to access?[/color]
          You need to create a dynamic login webpage. See the following HTML
          code sample. You can cut & paste the important parts such into your
          ..ASP webpage.


          <QUERY NAME="Get_ID" DATASOURCE="Dat abase1">
          SELECT Password,LastNa me
          FROM accounts
          where Username ='#form.myUseri d#'
          </QUERY>

          <IF Get_ID.Password is '#form.mypasswo rd#'>
          <P>
          <OUTPUT>Authent icated</OUTPUT>
          <P>
          <SET Account_ID=#for m.myUserid#>
          <SET Account_PW=#for m.mypassword#>
          <SET Account_LN=#Get _ID.LastName#>



          <!--- <QUERY NAME="LogAccess " DATASOURCE="Dat abase1">
          INSERT INTO AccessLog (LastName,Acces sDateTime)
          Values ('#Get_ID.LastN ame#',#Now()#)
          </FQUERY> --->

          #form.myuserID# -- #form.mypasswor d# -- #get_id.recordc ount#<BR>
          <LOCATION URL="mainpage.h tml"">


          <ELSE>
          <output>
          <HTML>
          <HEAD>
          <TITLE>Access Error</TITLE>

          </HEAD>

          <BODY BGCOLOR="white" >

          <P><CENTER><I MG SRC="../../gifs/database.gif"
          ALIGN=bottom></CENTER></P>

          <TABLE CELLPADDING="0" WIDTH="450" CELLSPACING="0" BORDER="0">
          <TR ALIGN="left">
          <TD VALIGN="MIDDLE" ALIGN="LEFT" WIDTH=450><b>Ac cess Error</B></FONT>
          <P>

          The User ID or Password that you entered is incorrect. Please try to
          <A HREF="index.htm l">log in</A> again
          <P>
          <BR>
          </p>
          </TD>
          </TR>

          <TR>
          <TD align="center">
          <P><CENTER>
          <HR WIDTH="70%">
          <HR WIDTH="70%">
          </CENTER>
          </TD></TR>


          </TABLE>
          </BODY>
          </HTML>
          </output>
          </IF>

          [color=blue][color=green]
          > > Good Luck!!!
          > > pjac[/color][/color]

          Comment

          • rob

            #6
            Re: Access database and web pages , nubie problem!

            Hi all again.
            Thanks for the pointers , but I am still a little confused. i.e
            Situation normal :0)
            The article that I worked from

            makes no mention of editing web pages or any html code. Am I missing
            something.
            In the article you make an .asp page from 'Products' in the Northwind
            database , and use Simple layout.htm as the "template". I did this ,
            but when I open Simple layout.htm I get a whole lot of stuff that has
            NOTHING to do with
            the Northwind dbase. I can't seem to open Products.asp either.
            When you open Simple layout.htm with internet explorer should you not
            see the
            Products table from the database?
            I am pretty sure the ODBC stuff is correct.
            As I said I am new to this , so I pretty sure I am missing something
            obvious to you guys.
            Cheers
            Rob


            pjac@erols.com (pjac) wrote in message news:<9435ccd8. 0311181143.2dc3 7368@posting.go ogle.com>...[color=blue]
            > I suggest that you acquire a Front Page Bible and a HTML book from the
            > library. It explains everything very well and is easy to use. To
            > create a dynamic HTML webpage that retrieves data from the database as
            > opposed to a static data access page, you need the following items:
            >
            > OBDC connection--DSN (go to Start button on your Windows taskbar, to
            > the Control Panel, ODBC icon. Set up your DSN (datasource) where the
            > database is located.)
            >
            > MS-Access Database (2 tables: Accounts,Access Log....)
            >
            > 2 webpages (login.asp) and (mainpage.html)
            >
            > Web Browser (Internet Explorer)
            >
            > Web Editor (front Page, Word, cold fusion, etc..)
            >
            > Create a login form in MS-Access that has all the necesary fields
            > (firstName, lastname, address, etc...), In the menu go to FILE, Save
            > as Dynamic HTML (follow the prompts). Open the saved webpage in a Web
            > Editor so that you can see the HTML code. See example below for code.
            > The textboxes on your login form must have the same names, such as
            > myUserid, mypassword,last name....These pass the values typed into the
            > webpage back to through the ODBC connection to the database.The user
            > gets an error message if nothing matches the database. It goes to the
            > next page (mainpage.html) that you have created to say thank you it
            > the match is correct.
            >[color=green]
            > > How do you set up a webpage where the user must enter a password to access?[/color]
            > You need to create a dynamic login webpage. See the following HTML
            > code sample. You can cut & paste the important parts such into your
            > .ASP webpage.
            >
            >
            > <QUERY NAME="Get_ID" DATASOURCE="Dat abase1">
            > SELECT Password,LastNa me
            > FROM accounts
            > where Username ='#form.myUseri d#'
            > </QUERY>
            >
            > <IF Get_ID.Password is '#form.mypasswo rd#'>
            > <P>
            > <OUTPUT>Authent icated</OUTPUT>
            > <P>
            > <SET Account_ID=#for m.myUserid#>
            > <SET Account_PW=#for m.mypassword#>
            > <SET Account_LN=#Get _ID.LastName#>
            >
            >
            >
            > <!--- <QUERY NAME="LogAccess " DATASOURCE="Dat abase1">
            > INSERT INTO AccessLog (LastName,Acces sDateTime)
            > Values ('#Get_ID.LastN ame#',#Now()#)
            > </FQUERY> --->
            >
            > #form.myuserID# -- #form.mypasswor d# -- #get_id.recordc ount#<BR>
            > <LOCATION URL="mainpage.h tml"">
            >
            >
            > <ELSE>
            > <output>
            > <HTML>
            > <HEAD>
            > <TITLE>Access Error</TITLE>
            >
            > </HEAD>
            >
            > <BODY BGCOLOR="white" >
            >
            > <P><CENTER><I MG SRC="../../gifs/database.gif"
            > ALIGN=bottom></CENTER></P>
            >
            > <TABLE CELLPADDING="0" WIDTH="450" CELLSPACING="0" BORDER="0">
            > <TR ALIGN="left">
            > <TD VALIGN="MIDDLE" ALIGN="LEFT" WIDTH=450><b>Ac cess Error</B></FONT>
            > <P>
            >
            > The User ID or Password that you entered is incorrect. Please try to
            > <A HREF="index.htm l">log in</A> again
            > <P>
            > <BR>
            > </p>
            > </TD>
            > </TR>
            >
            > <TR>
            > <TD align="center">
            > <P><CENTER>
            > <HR WIDTH="70%">
            > <HR WIDTH="70%">
            > </CENTER>
            > </TD></TR>
            >
            >
            > </TABLE>
            > </BODY>
            > </HTML>
            > </output>
            > </IF>
            >
            >[color=green][color=darkred]
            > > > Good Luck!!!
            > > > pjac[/color][/color][/color]

            Comment

            Working...