I have a page that brings back all records from a table in a SQL database.
How can I limit the number of rows to display on the page and then have a link on the bottom for page 2 with the rest of the rows and so ?
For example - I have 500 rows of data in tableA. When I run this query page that brings back everything, I want to display the first 200. And then the user can select the next 200.
On entering some parameters by the user, a form comes up with the values retrieved from the database (i.e. dynamic table is generated.) Also, I have a select all checkbox for selecting all the rows.
Since sometimes the rows fetched are more than 500, I want to limit them to 30 rows per page with the option to go to new page with select all checkbox (as in yahoo, hotmail inbox) . How can I achieve this ?? Code:
I'm trying to specify how many records to be display per page. I put a limit of 40 records and i'm getting only 2 per page. The number of pages it seems ok but the records displayed are only 2 instead of 40. Code:
When ever i try to search for a number in a form to bring back the customers info i get no result returned! However the customer exsist in the database. What could be the problem?? Code:
Status ---------------------------------------------------- | StatusID | DateFrom | DateTo | EmployeeID | Type | | . | . | .
I need to retrieve a list of employees, which are not scheduled for work between the given dates and which have no status (sick leave, maternity leave etc). The object is to see which employees are available for scheduling on the different dates.
The resulting table/recordset should contain one record per date per available employee (see example below). Code:
I've got an access database with a field containing dates (each saturday of the year), set up as a date field. In my code i need to write the SQL to select all records that have a date after todays date.
I've got the rest of the code but it's the where clause i'm stuck on. Something like, WHERE mydatefield is after (could i use >?) currentdate. Not really sure how ot go about doing this... I'm using ASP, is there a way the SQL can get the current date, or would i need to generate it and store as a variable first? Also, don't know what type of quotes i would need to use " or ' or + etc.
I am new to ASP and I want to use a query which links one record in a table to another record in the same table to display a list of values. The query lists the names of all managers (the managers staff no is held in the reports_to field of an employee)
Set rs=Server.CreateObject("ADODB.Recordset")
rs.Open "SELECT DISTINCT p2.Surname + ', ' + p2.[First name] AS Expr1 FROM People p1 INNER JOIN People p2 ON p1.reports_to = p2.[Staff no] WHERE (p1.[Staff no] IS NOT NULL)",con,3,3 while not rs.EOF %> <option value="<%=rs("p2.surname")%></option> <% rs.MoveNext wend rs.Close
However it doesn't like the alias (p2). Is it possible to return a list from this type of query?
I have an ASP page where I want to display the 3 most recent records within a database using a SQL query. The problem is that my page which output the results is only showing the first most recent record and not the two past ones aswell.
Am I right in thinking that might be related to the 'loop' function? I know that my SQL code is fine as I have previewed the results from the code and they are correct. Code:
The problem concerns 2 tables, cart_products and cart_shoppingcart.
Cart_products contains all the product data (eg, prices, product's key name, etc), but most importantly, it contains the quantity of stock (prod_quantity) for each item.
cart_shoppingcart contains all of the user's items in their shoppingcart, including those that are part of an (customer) order; these have the order_number to differentiate from those that aren't in any order (their Order_number is 'no_order', the others have the order number).
Now, what I want to do is this:
For every item in the order (ie, every entry in cart_shoppingcart that matches the username and order number), take the quantity (x) the customer is ordering, then take the quantity of stock remaining (y), then subtract x from y to create the new stock level (z) and update the appropriate record in cart_products with z (all this with SQl preferably).
I was thinking of using a Do while loop, but realised that it wouldn't work as I'd have to use several SQL statements and then I'd run into a problem the minute ASP reads "objrec.movenext".
I'm trying to pull the last 5 records from my database.
<% j=5 rs.MoveLast While ((j>0) AND (NOT rs_article.BOF))%> ''Execute HTML and data insertion here
<%rs_article.MovePrevious j=j-1 Wend%>
Everytime I attempt to run this code, I recieve an HTTP 500- Internal Server Error. It tells me no more than that. I know that my connection settings are OK because when I move forward through the database (first five records), the code executes without error. And yes, my Cursor type is Dynamic.
Alternatively, I would also like to know how to add new recordset to the beginning of a database rather than the end.
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.
I am trying to figure out how to create a registration form that can limit that amount of people who are signing up for an event.
The form has to take in consideration the number of guests the attendee is bringing table seating location. How can interact with the database in order to do this. I know how to create a form and send that information to a database.
I have a web application that query and insert record into a remote DB2 database. It has an ODBC setup pointing to a remote UNIX DB2 database server. The problem that I ran into today is that IIS created too many DB session which max out my limit at the DB2 side. I see a lot of "mtx.exe" when I check the db applications of the db server.
Even thought I close my db connection after each query, it seems to stay around and occupying a session on the DB server. So I ended up with a lot of people with failed insert or login because there are no more available session on the db server.
So my question is how can I set a limit on the DB connection? How can I make sure "mtx.exe" disappear after a query? What other option do I have?
I've made an ASP page that use a VB6 ActiveX EXE with a CreateObject. Initially, this page work fine. The object’s reference created with the CreateObject are saved on a session variable for reuse it on many page. When many users call this page and many instance of the ActiveX EXE Object are created, the CreateObject command fails with a 429 error (ActiveX component can't create object). The class (in ActiveX EXE) are MultiUse, then only a single EXE are running. Terminating the EXE with Task Manager then the CreateObject will get to work again.
I'm pulling product descriptions from the database and would like to limit the number of charcters that is displayed. Also, I'd like to add ... at the end.
Something like: This long text is boring blah blah blah
I'm starting in asp and I'm trying to do a simple sql query to display a number of records on a page using the limit clause. I keep getting a syntax error in my from clause. Here's what I'm doing:Code:
rstProd.Source = "SELECT * from TBL_PRODUITS LIMIT 0,10"
I have no problem using this clause with PHP so I was wondering if there's some restrictions with it in ASP??
I've got a small problem with my ODBC query that I'm unable to resolve by searching google. I need to limit my query so that it only returns a certain ammount of rows, for example 10.
I have tried the MySQL type query and that failed to work. Then I found an example on the internet in what looked like a weblog which said use "select top 10 * from tblname". Although this fails to work it does limit it when it feels like it. Often I'll get 11 or more results, but if I decrease the 10 to 4 for eample it still returns the same 11 or more rows.
its there anyway via asp i can get around the 255 character limit for url strings.. its for use in a cms/eshot system. on a mailto: link i want to create a string of email address for the client and then send from there own inbox.
I am having a problem uploading large files through ASP.We have several sites in IIS on 1 application pool.I was able to use MetaBase Explorer and increase the AspMaxRequestEntityAllowed value in /LM/W3SVC, and for at least 1 of our sites, it worked. Unfortunately, on our Intranet site, the error persist. Does anyone have any idea why? We do have ASP.Net installed on this server, but the error is explicitly ASP.
Searching for answers I found that another value, MaxRequestEntityAllowed, could also be responsible. Unfortunately, this value is not anywhere in our metabase.xml file, and I am hesitant to simply create it.
I think an url variable could be limited, maybe someone know the maximum length I can use ? (I try to send an html code with the get method, maybe some symbols could not be accepted in url).Is this length limited for a variable or for the url string ?
We're running Windows 2003 Enterprise Edn.with IIS 6.We'd like to limit the access to two of our ASP apps to those who are on the domain--without using the integrated domain authentication popup.
In other words,we don't want users on the domain to have to log in every time (or even once);those not on the domain would not see the site at all. Is this possible?How?
I have a Visual FoxPro table with Memos fields, and when i insert into the table a value that cames from a TEXTAREA field on a form, give me an error. Why? if the table field is MEMO?
is there any reason why i can view a page at work (which is on our server) yet when i view it online from the domain name (some pages are hosted, some are running off our server) i get the message: "Redirection limit for this URL exceeded. Unable to load the requested page. This may be caused by cookies that are blocked."