I have a sql statement that pulls up a certain amount of records according to a requirement. Let's say that 20 records show up. I want to get to the 5th one. Well now I know that I can use the move() function to enable that, but it is the same page.
The page executes the sql statement and by default shows the last record in the query. Now when I ask for the 5th record the page is reloaded, the sql statement exectures AGAIN and the 5th record shows up. Is there way to ask for the 5th record without having to re-executing the SQL statement?
The application is an ASP app using a Sql Server 2000 back end, w/ IIS 5.5. It uses NT authentication. We use BigIP for load balancing across 4 servers, and have enabled active cookies for state maintenance w/in BigIP. An employee_ID and some other basic identifying info is stored in the cookie.
After significant log file and SQL Server Trace review, I've determined that the application is reusing existing sessions and their stored information when it shouldn't. What happens is that a user logs in and works for a while under a session id. At some point, a second, new, session ID is created for them. At this point, if another user logs in, they (may) be using the original users first session ID, with all of the original users identifying info. I haven't been able to isolate exactly what causes the new ID to be created in the first place, it isn't consistent. Obviously, this causes all sorts of problems, "turning one person into another" as the users say.
I'm at a loss. With the session ID tracing back to a different user, all the normal ways to ID the logged in user -- like the Logon_User server variable -- trace to the wrong person. I have determined that IIS logs the cs_Username for the user that's really sitting at the computer, the "correct" user. If I could find a way within the ASP code to pick up that cs_Username, I could circumvent the problem by modifying the session state check include file, but I've had no luck.
Is there any method to check existing session objects for a session object containing user say for eg "XYZ"
The requirement is to reuse the session object if a user failed to logout and is trying to login again from a different machine or a new browser window.
I donot wish to store this info in db. if the session exists i wd just use it rather than create a new one.
If I have a complex SQL statement that I want to use on several pages, what's the best way of going about it? Do I put it in an include or should it go in a sub or function or something else?
I have an sql statment with an in statment for ID . I'm trying to get the CompanyID in ( ) but all i get is just the word companyID with no value . i used response.write request.form("companyID") so i know the value is coming to the other page, this is what i have now.
I am trying to pass a variable from another page to a sql statment. The variable specifies the one of the columns that I want the sql query to return. I also want to display field contents of the column later in my page. I can't seem to get this to work. Can someone give me a hand? Here is my code:
Given the following that results from a form which has multiple checkboxes with the same name value, the resulting string when stored into a variable is this - 129,200,323,330 I used the replace function and got this - 129 OR 200 OR 323 OR 330.
I want to somehow use these values (ints) to specify the particular records in an access database and populate a record set.
When I do this, I get nowhere - "Select * From images WHERE id=" & img_ids Whereas img_ids is the above string...
if left(session("lastPage"), 5) <> "admin" then session("return") = session("lastPage") else session("return") = "" end if
My problem is even the "left(session("lastPage"), 5) is equal to "admin" it still not equal the variable session("return") to "". Can anyone please tell me why or what Im doing wrong?
I am hoping that some one can tell me how to add an ORDER BY statement to the following:
<% set rst = createobject("adodb.recordset") set rst = conn.execute("select RegClassID, StartDateTime, EndDateTime, Description, Location, SpecialNotes from CAL_EVENTS_REG_CLASSES where RegistrationID = "&RegistrationID) if not rst.eof then %>
The recordset returns fine, execpt I need to be able to order it ASC
im trying to write a sql statment that will insert a variable number of fields into a database the code below is what i want to do but i know this wont work anyone any ideas? or even if this can be done?
sSQL = "INSERT INTO sometable("&For Each field In Request.Form ; "&Field&"," next ; &")values"('" "&For Each field In Request.Form ; "&Request.Form(Field) &"','" next ; &""')"
i want to display the number of people logged on at each location... when someone logges in they get a type=1... that works great but when i try to group by the NasName thats the location name.. Code:
ContentID is primary_key ID and it is automaticlly created upon this insert, but want to also insert that content id in table Category column ContentId. Code:
I'm getting this useful error '80040e14' when trying to run a select statement in an ASP page. The connection to SQL Server 2000 is ok. The variables in the Select statement, 'area' or 'areaid' are passed through form the previous page ok.The code is below... Any ideas? Is it something obviously dense on my part?? Code:
i have a select case statement that checks for a couple of options e.g.
<%select case aParameters(0) case 0 %>
.. some code
<%case 2 %>
however i would like to test for a certain condition within the select cases statment. To see if a session variable exists before implementing some code:
I am Trying to use the SQL SELECT Statment to open records from multiple tables into one recordset.
I know the basic syntax of the Select statment but I wanted to know if its possible to recive the table name from the feild or the record that I am readinf from the recordset in any given moment.
To make things more clear, my example:
-Open a connection
SQL = "SELECT * FROM TABLE1,TABLE2 WHERE TABLE1.UserID=" & uid & " And TABLE2.UserID=" & uid
rs.open sql,conn,3,3
while not rs.EOF
-read from record
rs.movenext wend rs.close conn.close
now, in the part that I read from the record, is their any way I can know if that record is from table1 or table2?