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 derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Hi, i am now doing a project on dis

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
Hi, i am now doing a project on displaying user data whenever they log into the website. I must be enable to display all the members' resume on the website. i have 2 ASP pages. One is called try1.asp and the other is called time.asp. And i have the following code:

'try1.asp

<%
Dim DataConn, RsPerson, SQL
Dim SQLstr

Set DataConn = Server.CreateObject(&quot;ADODB.Connection&quot;)'change your server name to replace omega and name of database to replace 2K04
DataConn.ConnectionString=&quot;driver={sql server};server=CON7; database=user;DSN=localserver;PWD=;UID=sa;&quot;
DataConn.Open
SQL = &quot;select * from info where UserID = '&quot; & Request(&quot;text1&quot;) & &quot;' and Password='&quot; & Request(&quot;password1&quot;) & &quot;'&quot;

%>

<%

if (Request(&quot;submit&quot;) <> &quot;&quot;) then

'SQLstr=&quot;select NameID from info UserID= &quot; & request(&quot;text1&quot;) & &quot;' and password = '&quot; & request(&quot;password1&quot;) & &quot;'&quot;

Set RsPerson = DataConn.Execute(SQL)
if not RsPerson.eof then

'name= Request.Form (&quot;SQLstr&quot;)
Response.Redirect (&quot;time1.asp&quot;)

Else%>
<script>
window.alert (&quot;Invalid records&quot;)
</script>

<%end if%>
<%end if
%>

And i am able to login. But when come to the 2nd page:

time.asp

<%

Dim h, name
Dim DataConn, ConnString
Dim objRs

SQL= &quot;select * from info where UserID = '&quot; & Request(&quot;text1&quot;) & &quot;' and Password='&quot; & Request(&quot;password1&quot;) & &quot;'&quot;

h = hour(now())
response.write &quot;<html><head><body bgcolor='#000000' text='#ffff00'><center>&quot;
Response.Write &quot;<font face='verdana' size='+2'><p>&quot;
response.write(&quot;<p>&quot; & now())
response.write(&quot; (Singapore Time) </p>&quot;)

Session.SessionID (NameID)

If h < 12 then
Response.Write (&quot;<p>&quot;)
response.write(&quot;Good Morning!&quot; &
response.write(&quot;<p>You have logged in!</p>&quot;)
Response.Write (&quot;</p><p>&quot;)
else
Response.Write (&quot;<p>&quot;)
response.write(&quot;Good Afternoon!&quot; & Response.Write objRs(&quot;NameID&quot;))
response.write(&quot;<p>You have logged in!</p>&quot;)
Response.Write (&quot;</p><p>&quot;)
End if


i am unable to extract the info from the database to display onto the net. So what must be the SQL statement be in order to exract the info from the databse in the 2nd ASP page.
ThankYOu!!
 
In try1.asp you should pass Userid(which i guess unique)
Response.Redirect (&quot;time1.asp?Userid=&quot; & Request(&quot;text1&quot;) )

So on next page you will receive this value.

Now fire aquery to fetch results from database on this page. Rushi Shroff Rushi@emqube.com
&quot;Life is beautiful.&quot;
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top