Ask a Question related to ASP Database, Design and Development.
-
the chad #1
Using an asp page to return a sql query
I know that there must be a way to do this, but in my limited
knowledge I am stuck.
I am using 2 tables
1. "BTstatus"
BugIndex
Date Entered
Company
Technician
Developer
PROGRAM
Status
PRIORITY
2."noc"
Bugindex
# of calls
Description
Bug index is the common key
I would like to display the first table and when you click on the
Bugindex it would display like a select * from noc where bugindex ='?'
?= the bugindex #
To go along with this on the new screen I would like to be able to
update the # of calls for that particular bugindex. There are a ton of
things out that that are sorta like this but nothing specifically.
Thank you
the chad Guest
-
I want to return an array instead of a query
Dear Forum, My Flash program uses a web service connector that connects to a CFC. Everything works well with "return type="query. Now, I would... -
SQL Query not return date if we use <> operators
Hi, I am in a way at this moment where I have to find records from tables where date are the primary field to be validated. In another word, I... -
Query return code question
All... I'm having problems figuring out what pg_query() really returns when there is an error. The documentation says it returns "FALSE",... -
query to return table structure
hi, Is there any command or query that returns the table structure informix. -
Prevent 'Page has expired' when a client hits back to return to a search page
I have a search page that I want to enable private caching so that when a user hits the back button they dont get the page has expired error. I... -
SPA #2
Re: Using an asp page to return a sql query
OK I am assuming you know how to connect to your database and retrieve recordsets for the 2 tables you have mentioned.
Lets the connection object is objConn, the recordsets rsBTStatus and rsNOC.
Your main asp page should have the following code:
<%
:
:
<Database connection code>
:
%>
<Table width="100%">
<TR>
<TH>BugIndex</TH>
<TH>Date Entered</TH>
<TH>Company</TH>
<TH>Technician</TH>
<TH>Developer</TH>
<TH>PROGRAM</TH>
<TH>Status</TH>
<TH>PRIORITY</TH>
</TR>
<%
While not rsBTStatus.EOF
%>
<TR>
<TD>
<A HREF='NOC.ASP?Bindex=<%=rsBTStatus.Fields(0)%>'><% =rsBTStatus.Fields(0)%></A>
</TD>
<TD><%=rsBTStatus.Fields(1)%></TD>
<TD><%=rsBTStatus.Fields(2)%></TD>
<TD><%=rsBTStatus.Fields(3)%></TD>
<TD><%=rsBTStatus.Fields(4)%></TD>
<TD><%=rsBTStatus.Fields(5)%></TD>
<TD><%=rsBTStatus.Fields(6)%></TD>
<TD><%=rsBTStatus.Fields(7)%></TD>
</TR>
<%
rsBTStatus.MoveNext()
Wend
%>
:
:
<Close recrordsets and connection>
Now your NOC.asp page should contain the following code:
<%
:
:
Dim strBugIndex
Dim strSql
strBugIndex = trim(Request.QueryString("Bindex"))
:
<Database connection code>
:
strSql = "Select * from NOC where BugIndex= ' " & strBugIndex & " '
(Note: Theres no space between the single and double quotes)
rsNOC.Open strSql, objConn
%>
<Table width="100%">
<TR>
<TH>BugIndex</TH>
<TH># of calls</TH>
<TH>Description</TH>
</TR>
<%
While not rsNOC.EOF
%>
<TR>
<TD><%=rsNOC.Fields(1)%></TD>
<TD><%=rsNOC.Fields(2)%></TD>
<TD><%=rsNOC.Fields(3)%></TD>
</TR>
<%
rsNOC.MoveNext()
Wend
%>
:
:
<Close recrordsets and connection>
Havent tested the above code .. but hope you got the idea now .. clicking on the BugIndex link on the first page will open a new window with the NOC table listing records having the BugIndex that you clicked.
HTH
SPA
"the chad" <cswartz@stromberg.com> wrote in message news:d5957558.0307310905.3c7734b3@posting.google.c om...> I know that there must be a way to do this, but in my limited
> knowledge I am stuck.
>
> I am using 2 tables
> 1. "BTstatus"
> BugIndex
> Date Entered
> Company
> Technician
> Developer
> PROGRAM
> Status
> PRIORITY
>
> 2."noc"
> Bugindex
> # of calls
> Description
>
> Bug index is the common key
>
> I would like to display the first table and when you click on the
> Bugindex it would display like a select * from noc where bugindex ='?'
> ?= the bugindex #
>
> To go along with this on the new screen I would like to be able to
> update the # of calls for that particular bugindex. There are a ton of
> things out that that are sorta like this but nothing specifically.
>
> Thank youSPA Guest
-
The Chad #3
Re: Using an asp page to return a sql query
I am assuming this would be an acceptable connection statement?
<%
Dim conn
Set conn = Server.CreateObject("ADODB.Connection")
conn.Open "Provider=SQLOLEDB; Data Source = (local); Initial Catalog =
techsupportBT; User Id = sa; Password="
If conn.errors.count = 0 Then
Response.Write "Connected OK"
End If
%>
IIS and SQL are on the same box
*** Sent via Developersdex [url]http://www.developersdex.com[/url] ***
Don't just participate in USENET...get rewarded for it!
The Chad Guest
-
Bob Barrows #4
Re: Using an asp page to return a sql query
The Chad wrote:
No, this is not acceptable: the sa account should never be used by an> I am assuming this would be an acceptable connection statement?
> <%
>
> Dim conn
>
> Set conn = Server.CreateObject("ADODB.Connection")
>
> conn.Open "Provider=SQLOLEDB; Data Source = (local); Initial Catalog =
> techsupportBT; User Id = sa; Password="
>
application (hopefully you don't really have a blank password for the sa
account ... )
Otherwise, it looks ok.
Bob Barrows
Bob Barrows Guest
-
The Chad #5
Re: Using an asp page to return a sql query
I am just using it for an intranet web page as more of a managment tool,
so I didn't figure security was that big of an issue for the situation.
Thank you for all of your help.
*** Sent via Developersdex [url]http://www.developersdex.com[/url] ***
Don't just participate in USENET...get rewarded for it!
The Chad Guest
-
Bob Barrows #6
Re: Using an asp page to return a sql query
The Chad wrote:
> I am just using it for an intranet web page as more of a managment
> tool, so I didn't figure security was that big of an issue for the
> situation. Thank you for all of your help.
>
Many companies are hacked by their own employees. And Slammer worked partly
because no passwords had been assigned to sa on the infected machines...
But it's only a job ... you can always get another one ...
Bob
Bob Barrows Guest



Reply With Quote

