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!

Unable to display Data due to this Error

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
Hi, i do not know what is the error is. My project is about when a user login in, his data is able to display onto the web. Example: Good Morning!, UserName
And when i do the coding, it give me this error:


ADODB.Recordset error '800a0bb9'

Arguments are of the wrong type, are out of acceptable range, or are in conflict with one another.

/hello.asp, line 24


And my coding is :
<%

Dim h, name
Dim DataConn, ConnString
Dim Rs, mySQL


mySQL= &quot;select NameID from info &quot;
set Rs=server.CreateObject(&quot;ADODB.Recordset&quot;)

Rs.Open mySQL, DataConn




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;)


If h < 12 then
Response.Write (&quot;<p>&quot;)
response.write(&quot;Good Morning!&quot; & Rs(&quot;NameID&quot;))
response.write(&quot;<p>You have logged in!</p>&quot;)
Response.Write (&quot;</p><p>&quot;)
elseif h <18 then
Response.Write (&quot;<p>&quot;)
response.write(&quot;Good Afternoon!,&quot; & Rs(&quot;NameID&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 Night!,&quot; & Rs.Fields (&quot;NameID&quot;))
response.write(&quot;<p>You have logged in!</p>&quot;)
Response.Write (&quot;</p><p>&quot;)



Rs.Close
DataConn.Close
Set Rs = Nothing
set DataConn= nothing

End if%>


May i know how to extract the information from the DataBase and display on the 2nd ASP pages.

thanks...:-D
 
This part is wrong

If h < 12 then
Response.Write (&quot;<p>&quot;)
response.write(&quot;Good Morning!&quot; & Rs(&quot;NameID&quot;))
response.write(&quot;<p>You have logged in!</p>&quot;)
Response.Write (&quot;</p><p>&quot;)
elseif h <18 then
Response.Write (&quot;<p>&quot;)
response.write(&quot;Good Afternoon!,&quot; & Rs(&quot;NameID&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 Night!,&quot; & Rs.Fields (&quot;NameID&quot;))
response.write(&quot;<p>You have logged in!</p>&quot;)
Response.Write (&quot;</p><p>&quot;)



Rs.Close
DataConn.Close
Set Rs = Nothing
set DataConn= nothing

End if%>

First of all when h =1 it will jump into II loop.It should
go to I loop.So in second loop condition should be
elseif h > 12 and h < 18

Again there is an error in closing the database connection.
You have closed it in third loop so if III loop executes only then the statements will execute so cut them and paste it outside of end if.

Well For name Id,
After executing the statements,
you shuld take it in variable

Dim Username
Username=Rs.Fields (&quot;NameID&quot;))
Response.write Username
Response.End

So try to print thee result.If you see the real result then it must work inside where the name is used..

OK..

Rushi Shroff Rushi@emqube.com
&quot;Life is beautiful.&quot;
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top