By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
428,979 Members | 1,452 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 428,979 IT Pros & Developers. It's quick & easy.

Access database and web pages , nubie problem!

P: n/a
rob
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.html 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: se*************@yahoo.com
Nov 12 '05 #1
Share this Question
Share on Google+
5 Replies


P: n/a
se*******@yahoo.com (rob) wrote in message news:<89**************************@posting.google. com>...
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.html 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: se*************@yahoo.com


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:
http://www.bookgroup.org.uk
Nov 12 '05 #2

P: n/a
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 "Organization">
Order by Organization
</if>

<A href="yourwebpage.asp?"how=Name"> NAME </a> <!--remark name
link-->
<A href="yourwebpage.asp?"how=ID"> NAME </a> <!--ID name link-->
<A href="yourwebpage.asp?"how=Organization">Organizat ion</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
Nov 12 '05 #3

P: n/a
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" <pj**@erols.com> wrote in message
news:94**************************@posting.google.c om...
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 "Organization">
Order by Organization
</if>

<A href="yourwebpage.asp?"how=Name"> NAME </a> <!--remark name
link-->
<A href="yourwebpage.asp?"how=ID"> NAME </a> <!--ID name link-->
<A href="yourwebpage.asp?"how=Organization">Organizat ion</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

Nov 12 '05 #4

P: n/a
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,AccessLog....)

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,lastname....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.
How do you set up a webpage where the user must enter a password to access?

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="Database1">
SELECT Password,LastName
FROM accounts
where Username ='#form.myUserid#'
</QUERY>

<IF Get_ID.Password is '#form.mypassword#'>
<P>
<OUTPUT>Authenticated</OUTPUT>
<P>
<SET Account_ID=#form.myUserid#>
<SET Account_PW=#form.mypassword#>
<SET Account_LN=#Get_ID.LastName#>

<!--- <QUERY NAME="LogAccess" DATASOURCE="Database1">
INSERT INTO AccessLog (LastName,AccessDateTime)
Values ('#Get_ID.LastName#',#Now()#)
</FQUERY> --->

#form.myuserID# -- #form.mypassword# -- #get_id.recordcount#<BR>
<LOCATION URL="mainpage.html"">
<ELSE>
<output>
<HTML>
<HEAD>
<TITLE>Access Error</TITLE>

</HEAD>

<BODY BGCOLOR="white" >

<P><CENTER><IMG 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>Access Error</B></FONT>
<P>

The User ID or Password that you entered is incorrect. Please try to
<A HREF="index.html">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>

Good Luck!!!
pjac

Nov 12 '05 #5

P: n/a
rob
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
http://databases.about.com/library/weekly/aa011401a.htm
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
pj**@erols.com (pjac) wrote in message news:<94**************************@posting.google. com>...
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,AccessLog....)

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,lastname....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.
How do you set up a webpage where the user must enter a password to access?

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="Database1">
SELECT Password,LastName
FROM accounts
where Username ='#form.myUserid#'
</QUERY>

<IF Get_ID.Password is '#form.mypassword#'>
<P>
<OUTPUT>Authenticated</OUTPUT>
<P>
<SET Account_ID=#form.myUserid#>
<SET Account_PW=#form.mypassword#>
<SET Account_LN=#Get_ID.LastName#>

<!--- <QUERY NAME="LogAccess" DATASOURCE="Database1">
INSERT INTO AccessLog (LastName,AccessDateTime)
Values ('#Get_ID.LastName#',#Now()#)
</FQUERY> --->

#form.myuserID# -- #form.mypassword# -- #get_id.recordcount#<BR>
<LOCATION URL="mainpage.html"">
<ELSE>
<output>
<HTML>
<HEAD>
<TITLE>Access Error</TITLE>

</HEAD>

<BODY BGCOLOR="white" >

<P><CENTER><IMG 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>Access Error</B></FONT>
<P>

The User ID or Password that you entered is incorrect. Please try to
<A HREF="index.html">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>

Good Luck!!!
pjac

Nov 12 '05 #6

This discussion thread is closed

Replies have been disabled for this discussion.