Jump to content

Application variable as recordset


dhsd6061

Recommended Posts

Hello,I have been writing my first asp application and am creating an Application variable to contain a recordset which contains login id, name, etc. I have been successfull in creating the variable, I call it Application("Logins"). My problem is accessing it in the asp pages. I am able to do:For each i in Application("Logins") Response.write("</br>" & iNextThis prints everything in the recordset. How can I access the infomation in the variable as if it were a recordset? ie. I would like run an SQL statement against it.SELECT name FROM App("Logins") WHERE 'UserID' = 'bill1'Is it possible? Is it possible to access records row by row.... App("Logins").MoveNext??? thanks,chris

Link to comment
Share on other sites

no it is not possible to run sql statements on Application variables.Is this how you are authenticating users to login to your site???If so you should use Session("user"), Session("password")...etc.Sessions are on a user by user basis and will expire when the browser is closed.An Application variable will not expire until the application is stopped via IIS. That means even when someone closes the browser, their credentials stay in the App variable and it keeps growing consuming more and more memoery until your app hangs.

Link to comment
Share on other sites

no it is not possible to run sql statements on Application variables.Is this how you are authenticating users to login to your site???If so you should use Session("user"), Session("password")...etc.Sessions are on a user by user basis and will expire when the browser is closed.An Application variable will not expire until the application is stopped via IIS. That means even when someone closes the browser, their credentials stay in the App variable and it keeps growing consuming more and more memoery until your app hangs.

Link to comment
Share on other sites

I am using session variables to authenticate the users. When I want to update information for my users, I need to spoof their agency number in my UPDATE and INSERT queries. I was wanting to create an Application recordset that I could use on any page without having to run a query everytime everytime I need to make an update.There is an example on W3Schools ASP tutorial on how to add an Application array variable that contains a recordset. Problem is, there is no information on how to traverse the array once it is created. The: for each i in Application("Logins") is the only way I know how to extract the data. If I have to write an algorithm to search the data and find what I need, I might as well just open a new recordset everytime which I can run quieries against. More functional and with the same amount or less coding.Any ideas??thanks,chris

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...