ASP And SQL Query Timing
Can ASP pull the time it takes for a query to be hit on a DB and returned?
I see outputs like :
"6 results, query took 0.24 seconds"
I know the "6" comes from a record tally, but how can I calculate the time?
View Replies
ADVERTISEMENT
I did a program with allowed to user to upload an excel file and insert those data into the access database. I did the testing on xp pro and to upload abt 300 records took me less than a minute.
However, the computer which the program is to be located is using windows 98. So i dowlnoaded the free server thingy. The upload time for 300 records here took about 15 minutes. haha
Just want to know what makes the uploading time so different?
View Replies
View Related
I have been tasked with producing a script that times the amount of time it takes to upload a file from client to server.Unfortunately for me, part of the spec is that the script must be written in ASP which is something I have about 30 minutes experience in.
I have been playing around with the script located at this address :
http://www.asp101.com/articles/jacob/scriptupload.asp
Which does almost everything I need, the only thing it doesnt do is tell me how many seconds/milliseconds/widgets it took to upload the file to the server (excluding time to write to disk once received)Can anybody point me in the direction of another script that can give me timings, or at least give me some pointers on how I can hack the above script to give me the data I need (I have already worked out how to get rid of the save to DB and user name option and this is now gone from the display page and the working scripts behind it)
View Replies
View Related
Is it possible to put a time counter on a page which say after 20 minutes will automatically terminate the session using the abandon function?
View Replies
View Related
I open a asp page where the user fills in some details in and submits the page. The form will be submitted and sent to a diffrent page, it will check and return whether the transaction was successful or not.
This is a timebound process the time starts as soon as the form get loaded. Suppose the time is 10 minutes so if the user fills in the form and submits the form. We would consider the transaction successful if we receive notificaton of the transaction being successfully completed within this 10 minutes limit, if it takes more than 10 minutes than we consider the transaction to be unsuccessful.
View Replies
View Related
I want to call a procedure 20 minutes after the page loads in vbscript. Could someone how to time the page?
View Replies
View Related
I have a piece of code that i created. It actually works as it should. The only problem is the objrs2.update causes an error-duplicate primary key. However when i check the database it has done what it should.
I then tried to use on error resume next, but it keeps timing out and i do not want to extend the time limit. Does someone know how to get round this? Code:
View Replies
View Related
I'm having a problem where I'm losing Session variables as soon as they've been set up. The user logs onto the system, the system sets some Session variables, and redirects to a menu page. The menu page checks the Session variables, can't find them, and asks the user to log in again - the second login is successful. Has anyone seen this before, and do you know what I should do about it?
View Replies
View Related
I have a small (half a meg or so of source, and a 2.5MB database, and a few images) ASP web app in place, and it's running fine except for the fact that occasionally people have session timeouts and are suddenly not logged in.
I've turned the session timeout in IIS up, but they still seem to get logged out in less than 15min, rather than 2 hours, as intended.
View Replies
View Related
I usually clean the session when the result page is presented to the user.
At this time, say an email confirmation was sent to the user and a pdf file
they can becdownloaded from the result page.
But if the user click the refresh or back button etc. for some reasons, they
pdf file is not available since it created on the fly when the request was
submitted.
So I am thinking about pull pdf file from database, but don't want the
database being hitted everytime the refresh button was clicked or the
requested is resubmitted.
View Replies
View Related
I am having a problem executing long running queries from an ASP application which connects to SQL Server 2000. Basically, I have batches of queries that are run using ADO in a loop written in VBScript. This works pretty well until the execution time of a single query starts to exceed some threshold, which I am trying to narrow down. I can typically run 2 - 10 queries in a loop, with the run time being anywhere from under a minute to an hour or more. Now that this application is being subjected to run against some large databases (25 - 40G), I'm having problems getting the application to continue beyond the first query if it takes a while to run.
I used SQL Profiler to try to diagnose what was going on. I can see the query executes to completion, but immediately after completing I can see an "Audit Logout" message, which apparently means that the client has disconnected. The query durations vary from 45 or 50 minutes to up to over 90 minutes. I have the ADO connection and query timeouts set to very large values, e.g. 1000 minutes, so I can't think its that. My guess is that there is some IIS setting or timeout that I am running up against and the connection to SQL Server is just dropped for some reason.
The configuration is
NT 4.0 SP6
SQL Server 2000 SP3
IIS 4.0
Explorer 5.5
I'm only running into this problem on the very largest databases we run against. The vast majority continue to function properly, but this is going to happen more often as time goes on the databases continue to grow in size.
View Replies
View Related
My code retrieves a username and a password from a form. Then this information is compared to some usernames and passwords that are stored in a database. The important thing here is that the comparison must be case sensitive meaning that "passWord" is not the same thing as "password"
I have this code, working fine in access 2003
SQL = "SELECT * FROM users WHERE StrComp(username_column,'" & entered_username_in_form & "',0) = 0 AND StrComp(password_column,'" & entered_password_in_form & "',0) = 0"
but get the following error when I run it against my sql 2005 database.
[Microsoft][SQL Native Client][SQL Server]'StrComp' is not a recognized built-in function name.
I don't know the corresponding t-sql for the query.
View Replies
View Related
I am running a querry on an access database and have set the number of records/page displayed at 20. if there are more than 20 records returned, then 1st page will show the first 20, the next page will show next 20 and so on....
The trouble:
the count of total records displayed is correct and the first page is displayed correctly. But when i click on *Next* to go to the next page, all the records of the database get displayed (not the 2nd page of records from the query).
View Replies
View Related
I am using ASP/MS ACCESS to see how I can query the same database, via 2 formfields.
{name: - search}Textfield 1: - Search by Category
AND/OR By
{name: - searchT}Textfield 2: - Location
Currently,
strSearchwords = Trim(Request.QueryString("search")); where "search" is the name of Textfield1
Which is fine, but how can I set it so that on Submit, the string from search, and searchT are somehow joined together into one string?
View Replies
View Related
In Access you use "*" + [passed variable] + "*", + can be replaced with &
Calling a parameterized query in Access requires % be used in place of *,
however, all that I have read show dynamic SQL passed to Access:
WHERE [some column] LIKE '" & ASPvar & "' % ORDER BY ...
However, my call is similar to:
conn.qMyLookup strVar, rs
If I modify the query in Access to:
"%" & [passed variable] & "%"
I get all records. If I only put it at the end, as suggested, I only get
matches at the end, not throughout the column. Code:
View Replies
View Related
Is it possible to write sql query to fetch records from
specific record number?
lets say i have one variable and it stores values such as
1,2,3 or so...
if variable contains, i want to fetch records from 1 to
20.
if it contains 2, then records should be from 21 to 40.
for 3, records would be 41 to 60...
what could be the sql for that?
i dont wannna fetch whole table and then filtering
through code..
View Replies
View Related
i have a table called checkrenewal
it has a field called date_renewal
data is stored like this
03/20/2007
05/17/2008
10/21/2006
09/18/2006
09/04/2006
so what i want to do is display only records that are in month of sept for 2006
so there will be 2 records
so next month is Oct 2006 so only display one record
so depending on which month and which year it is display only those records.
View Replies
View Related
I can't write the sum of a certain colum in a table of a db.
<%
sql_Sum_Tax="SELECT SUM(vtax) AS sql_Sum_Tax_RS_Var FROM orderstats
WHERE vcompletedate BETWEEN "& startDate &" AND "& endDate & ";"
Set sql_Sum_Tax_RS = Server.CreateObject("ADODB.Recordset")
sql_Sum_Tax_RS.Open sql_Sum_Tax, conn1
%>
<%=sql_Orders_Placed_RS("sql_Orders_Placed_RS_Var")%>
That last line generates this error:
ADODB.Recordset error '800a0cc1'
Item cannot be found in the collection corresponding to the requested name or ordinal.
View Replies
View Related
i have a table and the fields are
gender
weight
points
the records for example are
Male 55 2.0
Male 60 3.12
Male 65 3.87
Male 70 3.99
so i need to find out the points when the user selects gender and enters the weight
people are allowed to enter weights between 55 and 70
say for example someone enters weight as 55 his points will be 2.0
if someone enters weight as 64 i want the points to be 3.12
View Replies
View Related
I have an Access database of literature that I want to search using an ASP page using multiple search criteria (author, title, year, discipline,etc).
I'm using a form to collect the criteria from the user and then sending it to an ASP page. I'm creating the SQL statement using variables that pick up values passed from the form.
Code:
strSQL = "SELECT * FROM Literature WHERE " & _
"(Author Like '%" & mauthor & "%') AND " & _
"(Title Like '%" & mtitle & "%') AND " & _
"(Journal Like '%" & mjournal & "%') AND "& _
"(ArticleBook Like '%" & mBookOption & "%') AND " & _
"(Year Like '%" & myear & "%') " & _
"ORDER BY Title ASC;"
This would probably work if I used "OR" in my SQL, but I want to be able to use "AND." My problem is that I'm not getting records that have null values in some of these fields.
View Replies
View Related
Ive been working with queries through asp on a mdb file. The biggest problem i have is
that when i query a certian column that had embedded hyperlinks in it, the query also
returns the value of the hyperlink. Is there any way not to have to remove the hyperlinks
in the database and not have them show up on queries? Code:
View Replies
View Related
I am learning ASP from the Wrox Begining E-Commerce book, which uses Visual Basic to create a DLL and it also uses MTS as well.
I have been trying to find hosting not realising the problem with registering custom dll's on server and know realise that this isn't the best way to do this.
I wanted to know if there was anything i could do to change this. I have read a little bit about the Global.isa file but am not sure about this.
Could i just transfer all the code into the global.isa and then use it like this.
My website access a sql database and uses a mts pipeline for order processing.
I don't have enough experience of ASP to re-write this code and am not sure of what to do.
I have tried searching the web but am not really finding any solutions that I understand.
View Replies
View Related
I have one table with date field in sql server2000.I want to write one sql query statement that fetch last three months data from the current month..
View Replies
View Related
I am trying to have the SQL query select from a table where two conditions exist.
The line:
Code:
SQL = "SELECT * FROM CompsIn WHERE Out = -1 "
Works, but I want to have it also select from compsin where UserGroup = Session("UserGroup")
Until I connect the login and the CompsOut pages,adding Where UserGroup='CSU836'
will work just fine.
View Replies
View Related
i have a table called Cars which has fields like this
Car_Id
Purchase_Date
Purchase_Date has datatype as datetime in sql server
i have 2 fields on the form where the user enters the year and month and then submits the form on the next form i get the year and month like this
year=2005
month=02
i want to fire a query to get the car_id
View Replies
View Related
i have numbers in a column say
124
2345
1356
4569
and say 4569 belongs to joseph i want to tell what josephs rank is looking at the values his rank is 1
if 124 belongs to justin then his rank is 4
the more the points the higher the rank can someone tell me how my sql query will be
View Replies
View Related
The following Query causes my CPU Usage to go to 100% and the page will not load: Code:
View Replies
View Related
i have two field CustomerId and a MemberID. what i want is to get the MemberID number for the max CustomerID field take for example Code:
CustomerID MemberId
100 M00
101 M01
102 M02
103 M03
so i want M03
any suggestion how to write this query in sql?
View Replies
View Related
Is there a way to query for a users IP address with classic ASP/VBScript?
I'm building a local app that will feature a simple logging system. I'd like to have any user be able to update a form and when submitted, the page can look up the users IP and know that this update came from "Jeff's Workstation", for example.
There would only be 40 or so users, each of whom has a static IP that I could use to perform the lookup.
Can anyone point me the right direction, or perhaps suggest a better way to approach this problem?
View Replies
View Related
I have a column in a db which has valus separated by , e.g. 1,4,12,5
I want to be able to search the db and return info where a variable has similar values to the ones in the column. So they don't all need to be the same. They could be 18,4,9,199 and the common no. 4 would be matched and info extracted.
I have tried using % in my SQL but it doen't work 100%. (e.g select * from table where column_data LIKE '%"variable"')
View Replies
View Related
I need help with a SQL statement using AND OR properly. Say I want to list all records which are of the type page, state active but belong to different groups. My statement to list from one group might look like this:
Select * From Objects Where rs.Type=0 And rs.State=2 and rs.Group=3
Adding an OR clause, how would I list all groups (say 1-5)? Do I have to specify type, state and group 5 times?
View Replies
View Related
I am trying to compare the students current preference to all of the preferences they have already selected. ie: If they select a preference of '1', and they have already selected that preference before, then they get an error. This is the SQL that I have so far:
SQLPreference = "SELECT DISTINCT [tblStudents.Preference] FROM [tblStudents] WHERE (tblStudents.Student = '" & session("Valid") & "') AND (tblStudents.Preference = '" & Request.Form("Preference") & "');"
Now, this works perfectly when they have already selected that preference... They get the proper error. However, the problem is that if the two don't match up, then I get a 'Exception occurred' error. I know why this is happening... Simply because the SQL statement can't find Request.Form("Preference") in the database, and thus is generating an error. Code:
View Replies
View Related
i have this query but for some reason it is not working... Code:
SQL = "SELECT * FROM " & strTableName & " WHERE category = '" & cat & "' AND
i have a problem with the category part... for some reason it does not read it, but the variable cat is working fine because i had a response.write before and it displays it..
View Replies
View Related