IIS - form selection issue

Asked By Rich
26-Oct-09 03:53 PM
Hi,

I have an access database that contains 5 years worth of data.  The
table names are in the format of 4 digit year and tags, i.e. 2007tags,
2008tags, 2009tags, etc.  99.9% of the work will be querying against
the current year.  However there is the occasional needed to view past
years.  So I wrote some code that defaults to the current and asks the
user if they want to change it.  The problem is I cannot get to the
older data.  The code always defaults to 2009.  I really do not want to
create a page of buttons and the user chooses 2009 because that would
be extra work.

The goal is to have the system default to the current year.  When the
user selects 2008 and clicks on submit the queries should run again
against the 2008tags table.

What did I do wrong?


TR/html4/strict.dtd">
html, body {
height: 100%;
min-height: 100%;
}
body{
border:0;
margin:20px;
background-color:white;
color:black;
text-align:center;
}
select {
width:200px;
}
p {
width:200px;
display: inline;
}


Dim objconn,objRS,strSQL1
Dim year1
Dim i
Dim dogtagarray, rabiesarray, ownerstarray, ownerlastarray,
breedarray, pettypearray

If Not Request.form("year2") Is Nothing Then
year1 = year(date)
else
year1 = Request.Form("year1")
end if

Set objconn = Server.CreateObject("ADODB.Connection")
objconn.ConnectionString = "DRIVER=Microsoft Access Driver
(*.mdb);DBQ=" & Server.MapPath("tags.mdb")
objconn.Open
Set objRs = Server.CreateObject("ADODB.Recordset")
strSQL1 = "SELECT Tagno FROM " & year1 & "Tags ORDER BY TagNO ASC"
' response.write "dd " & year1
objRS.Open strSQL1, objconn
if not objrs.eof then
dogtagarray = objrs.getrows()
else
response.write "<h1>No records returned!</h1>"
response.end
end if
objrs.close

strSQL1 = "SELECT DISTINCT RabiesTagNo FROM " & year1 & "Tags ORDER BY
RabiesTagNO ASC"
objRS.Open strSQL1, objconn
if not objrs.eof then
rabiesarray = objrs.getrows()
else
response.write "<h1>No RabiesTagno records returned!</h1>"
response.end
end if
objrs.close

strSQL1 = "SELECT OwnerStName FROM Streets ORDER BY OwnerStName ASC"
objRS.Open strSQL1, objconn
if not objrs.eof then
ownerstarray = objrs.getrows()
else
response.write "<h1>No Street Name records returned!</h1>"
response.end
end if
objrs.close
OwnerStName
(1)
RabiesTagNo
(1)
Database
(1)
StrSQL1
(1)
Streets
(1)
Ownerstarray
(1)
Rabiesarray
(1)
Textbox
(1)
  Bob Barrows replied to Rich
26-Oct-09 03:43 PM
in the names of the tables. The "year" is data that should be stored in
a column of a single "tags" table.


Why would not you simply put a simple textbox that defaults to the
current year? Why are you thinking of creating all these buttons that
you would be having to change every year?

I do not know. What symptoms are you seeing?

--
HTH,
Bob Barrows
Create New Account
help
Insert / Database disabled IIS Hello OS: Win XP SP3 App. FrontPage 2002 With Frontpage open I want to Insert a database. However Database is disabled (greyed out). How do I enable the Database item? Regards Mike FrontPage Client Discussions Windows XP (1) Expression Web (1) Windows Vista (1 Windows 7 (1) Vista (1) IIS (1) XP (1) Database (1) You need to open FP on a server based web site (not a disc OS: Win XP SP3 App. FrontPage 2002 With Frontpage open I want to Insert a database. However Database is disabled (greyed out). How do I enable the Database item? Regards Mike Stefan Many thanks. Can I mimic a server based Website on my
IIS tia: Do I have to do anything other than install iis to have a database accessible through ASP? Joel IIS Discussions Joel IIS ASP (1) ASP.NET (1) ADO.NET (1) IIS (1) Console (1) Database (1) Database Web (1) Database providers (1) IIS, ASP or ASP.NET do not access databases. If it is ASP classic you are talking about, then it is ADO that provides the database providers that access a database. If it is ASP.NET you are talking about, then it is ADO.NET that provides the database providers that access a database. And your code ASP or ASP.NET must use the appropriate one (ADO or ADO
membership database IIS Does anyone knows how can i change the dafult membership database to another database, in MS Access? I have been googling but the examples do not seem to work Microsoft SQL Server (1) Site (1) Microsoft Access (1) Adrienne Boswell (1) Ricardo Furtado (1) Database (1) = ?Utf-8?B?UmljYXJkbyBGdXJ0YWRv? = wrote on 09 sep 2010 in microsoft.public.inetserver.asp.general: In MS-Access? Wrong NG. = = = = = = = = = = = = = = = = = = = = = = = = = = = = = Or in ASP? You can build any database and any function, but there is no default membership database in ASP. Not a good way to learn programming. If you want to have it use the visual studio 2010 default login controls. VS2010 connects to a MS SQL Server database, by default. My problem is that my database is in MS Access. I need to change the connection by default. Don't know
MS SQL Database access IIS Hi, I am learning how to access MS SQL database from ASP.NET and run into 2 problems: 1 / When a user from asp page is connected to database, I can not connect to the database from windows management console. My database was created as local. Could be this be a problem? Is it preferable to create database as the system db? 2 / IIS is set up to anonymous access and basic authentication I set up impersonate to true, so the user IUSER_username should be connected to the database. Is this solution secure enough or should I allowe another type of access? 3 / I during the development? 4 / What file I / O rights should be set up to the database mdf and ldf file? 5 / As I am using my own database, not ASPNET.mdb