Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Some help on ASP pages with MS Access DB backend pls 1

Status
Not open for further replies.

slakker

MIS
Jun 5, 2003
59
US
Hi.. I really need your help on this one guys..

I need to create an ASP page with a MS Access ( don't ask =\ ) backend database..
I basically need to fill the database with various info and then display it out in tables on an HTML page
It has to be a DNS-less connection to the database (db will reside local to the ASP pages)

A table will 7 colums with Date create, user posted, rank#, etc... at the top, then a Subject row.. and then a Description below that.

I also need to build an Admin web interfact with several admin ids/passwords that will be able to Add/Edit/Remove new data..
This whole site can be very simple as long as it works

Now a little about my experience.. I'm not a developer or programmer.. i'm a designer..
But, i've been using PHP/Perl scripts for a long time with MySQL backend..
I can install them, modify to my needs, and run on windows/*nix servers.. run mysql queries, etc..

But i've never used asp or even created an ms access db before..

Tried searching on the web for tutorials and reading a big fat book on creating websites with db's, but it wasn't that great.. no examples, just overviews

So, i'm asking for any help I can get.. even if it's just a link on some peace of info that'll help me

Thank you in Advance
 
Let me explain that last one further. If the record has a status of some severity, and I'm assuming that it's either Severe or Not Severe. Then it should be a Yes/No DataType.

If there are different severity levels like 1 through 5 then the field should be numeric using 1 through 5 and the code for the page can display different images for each level of severity. On the other hand, if that's the case, then why would you want to use images. Hence, the reason I'm assuming it is either one or the other. Is the severity either Severe or Not Severe?

Let me know if what I just said made any sense at all...hehe.
 
Ahh Slakker!. I see you got it figured out. Just refreshing your screen and saw you had it working prety good. Cool routine do you think?

Dave
 
One more thing. You can get the dropdown to display the option that you are currently filtering by doing the following to both the "ALL" line and the looped line...

CHANGE:
<%
<option value=&quot;MultiRecords.asp?MyApplication=All&quot;>All Applications</option>
<option value=&quot;MultiRecords.asp?MyApplication=<%=rsApp(&quot;Application&quot;)%>&quot;><%=rsApp(&quot;Application&quot;)%></option>
%>

TO:
<%
<option <%if MyApplication = &quot;All&quot; then%>selected <%end if%>value=&quot;MultiRecords.asp?MyApplication=All&quot;>All Applications</option>
<option <%if MyApplication = rsApp(&quot;Application&quot;) then%>selected <%end if%>value=&quot;MultiRecords.asp?MyApplication=<%=rsApp(&quot;Application&quot;)%>&quot;><%=rsApp(&quot;Application&quot;)%></option>
%>

Basically inserting into the option:
<%if MyApplication = &quot;All&quot; then%>selected <%end if%>

I always put it before the &quot;value&quot; as I have noticed programs like FrontPage sometimes reformat the whole option if it falls after the value. Also take note of the space that I put after selected. Like &quot;Selected &quot;. You're going to want it if the option is selected.
 
Dave... thanks again.. yes it's a Great routine!

And I have 5 different severities here.. 1 - 4, which i'd like to be images.. and 0, which can just be text saying &quot;N/A&quot;

And i tried to show the currently select app in the dropdown box, but it didn't work.. just stayed the same.. my code didn't exact match what you're saying.. because i couldn't find that code, but here is mine:

<form>
<select size=&quot;1&quot; name=&quot;MyApplication&quot; onChange=&quot;if(this.options[this.selectedIndex].value!='$') {window.open(this.options[this.selectedIndex].value,'_self')}&quot;>
<option selected value=&quot;$&quot;>Select Application</option>
<option <%if MyApplication = &quot;All&quot; then%>selected <%end if%>value=&quot;test.asp?MyApplication=All&quot;>All Applications</option>
<%
do while not rsApp.eof
%>
<option <%if MyApplication = &quot;All&quot; then%>selected <%end if%>value=&quot;test.asp?MyApplication=<%=rsApp(&quot;Application&quot;)%>&quot;><%=rsApp(&quot;Application&quot;)%></option>
<%
rsApp.movenext
loop
%>
</select></p>
</form>
 
Your <option> inside the loop also says &quot;All&quot;...

<%if MyApplication = &quot;All&quot; then%>

Rather it should say

<%if MyApplication = rsApp(&quot;Application&quot;) then%>
 
What are the 4 images for severity 1-4? Can you post a link to them?

Dave
 
Thanks for the clarification.. it works..

Here are my severity images:

images/severity1.gif - severity4.gif (this last one isn't created yet)
 
Dave.. If you want to see a newer version.. modified a bit to my needs.. here it is..

Hope you don't mind, and let me know what you think :)

I'd like to get rid of that extra space below the Filter box at the top.. i know the form tags usually put them in there.. i think i may have seen the code to that do somewhere on the web, but not sure what it is right now..

Any suggestions?

Here is my todo list for the page as of right now:

I want to replace the &quot;Last Updated&quot; data with a &quot;NOW&quot; asp tag.. so when the person enters new record via an admin page.. it'll show the time entered by the person in that field..
For the very first column with the NEW icon.. i'd like to have the NEW icon only show up if a record is no more than an hour old from the LastUpdated time.

For the Resolved column, i'd like to display a checkmark type of an image if field is set to YES.. if set to NO, then don't display anything
 
For starters you'll need to call the images for &quot;severity&quot;. If they are named like you said, all you have to do is the following:

<img src=&quot;severity<%=rs(&quot;Severity&quot;)%>.gif&quot; border=&quot;0&quot;>

===============

For the space under the dropdown move the form tags outside of the <td></td> tags. As follows:

FROM THIS:
<td width=&quot;100%&quot; colspan=&quot;8&quot;>
<form>
<select size=&quot;1&quot; name=&quot;MyApplication&quot; onChange=&quot;if(this.options[this.selectedIndex].value!='$') {window.open(this.options[this.selectedIndex].value,'_self')}&quot;>
'--option here--
</select></p>
</form>
</td>

TO THIS:
<form>
<td width=&quot;100%&quot; colspan=&quot;8&quot;>
<select size=&quot;1&quot; name=&quot;MyApplication&quot; onChange=&quot;if(this.options[this.selectedIndex].value!='$') {window.open(this.options[this.selectedIndex].value,'_self')}&quot;>
'--option here--
</select></p>
</td>
</form>

===============

>>I want to replace the &quot;Last Updated&quot; data with a &quot;NOW&quot; asp tag..

I am assuming that you want to timestamp the update. You're gonna do that on the processing page that you go to when they submit their update. Submit to another page where you have all your update code. At the top of that page set the variable...

<%NowTime = now()%>

Then in your update statement...

<%rsUpdate(&quot;LastUpdated&quot;) = NowTime%>

After the update completes just redirect back to the report.

<%
response.buffer = true

' --request form values here--

' --update routine here--

' --redirect here--
RedirectTo = &quot;test.asp?Application=All&quot;
response.redirect RedirectTo
%>

You don't have to pass the Application variable, but you can if you want to filter to just the group the the user has added an item for.

==============

The &quot;Resolved&quot; checkmark image I'm guessing you already have figured out.

<%=if rsApp(&quot;Resolved&quot;) <> 0 then%><img src=&quot;check.gif&quot; border=&quot;0&quot;><%end if%>

==============

Let me look into that 60 minute thing. I'll get back to you.
 
Or for a &quot;quick and dirty&quot; generic ASP open source solution to putting databases on the Web that just requires setting up a configuration page for each table or query and uploading the database to the Web as long as there is an autonumber field in each table (and you'll probably also separately want to create login capabilities), perhaps try something like this:
GenericDB by Eli Robillard
and then click on the Tips link to see an example


Best regards,
J. Paul Schmidt, Freelance ASP Web Developer
ASP Design Tips, ASP Web Database Demo, Free ASP Bar Chart Tool...
 
Sorry it took so long. I had to tuck the wife in...haha. She's pregnant and can hardly stand the late hours any more.

>>I'd like to have the NEW icon only show up if a record is no more than an hour old.

Well, here ya go. I had to think about this one for a minute. Let me know what you think.

<%LastHour = Now() - (1/24)%>

<%if rs(&quot;LastUpdated&quot;) >= LastHour then%><img src=&quot;new.gif&quot; border=&quot;0&quot;><%end if%>


Man, I hope the TekTip guys aren't upset about us taking up this whole thread. Hope they got a big hard drive.
 
Hey BullSchmidt I like the bar charts on your site. I thought of that same thing a few years ago, but I was going to have it span the last 30-31 days, like for sales trends and performance. I thought that maybe it wasn't going to be quick loading and started looking into graph generators. How does it work for you though?

You're out of Missouri eh? Nice state.
 
DaveGerard,

Yes, I really like Missouri - friendly people, but could use a few more lakes.

Thanks for the compliment on the bar charts!

Have used the bar chart for sales trends and that does seem like a natural application of it.

It works by manipulating table td cells which are given background colors.


Best regards,
J. Paul Schmidt, Freelance ASP Web Developer
ASP Design Tips, ASP Web Database Demo, Free ASP Bar Chart Tool...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top