Records After 10 Record
Is there any way to read the records after every 10 records
from database. I dont mean paging recordset here, but I need
to do that to generate table cells.
What I mean here is for example if we have 50 records in a table,
how can I get the every 10th record say, 40th, 30th, 20th and 10th record only .
Is there something like skip command in SQL or ASP?
View Replies
ADVERTISEMENT
I have been using this script which basically works fine, with on hitch. I populate a recordset from a database. Then, use the total number of records as a UBound.
I then want to display 9 random records. I get my 9 random images, but for some reason, if I do a sort by ID on the database, the lowest numbered ID file never comes up in the list. Here is my code: Code:
View Replies
View Related
We have an ASP site that hits up an Access database of categories of
products and products. (e.g. Categories = Napkins, Tablecloths;
Products = 20x20 Napkins, 21x21 Napkins, 54x54 Tablecloths, 60x60
Tablecloths)
We currently have select boxes that when you select a category, it
populates the next select box with the proper list of products (i.e. I
select Napkins as a category, I get a listing of the Napkins)
We would like to put a clickable link before each of these select
boxes that would pull up a pop up with links from the records from the
proper table.
(e.g. I click the categories link and a popup with html
anchor tags of Napkins and Tablecloths appear) I click on the Napkins
anchor and it populates the Categories Select box with Categories and
Napkins being selected.
View Replies
View Related
I'm getting this error message: Error Type:
Microsoft JET Database Engine (0x80004005)
You cannot add or change a record because a related record is required in table 'employees'. Code:
View Replies
View Related
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".
View Replies
View Related
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.
View Replies
View Related
I have an insert record form that posts fine to a db which automatically creates an ID how could I get the next page to do a preview using the ID just created by the DB to go to the right record?
View Replies
View Related
I have a .asp page which lists a date, then a bunch of record lines for data that falls within that date, then the next date and it's bunch of data record lines. e.g.
Ship Date: 04/06/04
Data xxxxxxxxxxxxxxxxxxxxx
Data xxxxxxxxxxxxxxxxxxxxx
Data xxxxxxxxxxxxxxxxxxxxx
Data xxxxxxxxxxxxxxxxxxxxx
Ship Date: 11/07/04
Data xxxxxxxxxxxxxxxxxxxxx
Data xxxxxxxxxxxxxxxxxxxxx
Data xxxxxxxxxxxxxxxxxxxxx
What I want is:
Ship Date: 04/06/04
1: Data xxxxxxxxxxxxxxxxxxxxx
2: Data xxxxxxxxxxxxxxxxxxxxx
3: Data xxxxxxxxxxxxxxxxxxxxx
4: Data xxxxxxxxxxxxxxxxxxxxx
Ship Date: 11/07/04
1: Data xxxxxxxxxxxxxxxxxxxxx
2: Data xxxxxxxxxxxxxxxxxxxxx
3: Data xxxxxxxxxxxxxxxxxxxxx
How can I get these numbers printed againsts the records ?
View Replies
View Related
I have an Access database with two fields that I would like to group by. The two fields are location and department. Field names are "Location" and "DeptName".
I have the code correct for grouping by location. That code looks like this: Code:
View Replies
View Related
I want to download record set from my SQL database as csv format but in ZIP file .I can download as a csv file now ..But i can't put that in zip file and download.
View Replies
View Related
how to deal with multiple recordsets on the same page?
It's gotta be something small and clear so I could understand.
Somewhere I've read that multiple recordsets are not allowed when using Microsoft Access Database?
View Replies
View Related
I am looking to
have some sort of SQL Trigger maybe? I have a field called 'dateActivated' and 'isActive'I'm looking to somehow say when dateActivated + 6 months then set isActive = false. I want this to
be automatic. I am using ASP/VBScript if this somehow matters.
View Replies
View Related
I have a form on an asp page which is used to add additional users to
the DB, i.e. adding a UserID (PK on table), Password & Email.
The companies are allowed a max of 3 users. If the company only has
the default 1 user and wishes to add another 1 or 2, then the form
displays the current user details, not in text boxes as this is not an
adit data form. The additional user/s can be entered into 1/2 rows of
text boxes, user 2 & 3.
If they decide to add 2 new users, how do I add the additional 2
records to my db table on submit ? Code:
View Replies
View Related
i am tryin to run a search on a db and am using a like statement which works fine but i want to select what it finds and also the next 9 records any idea on how to do this
View Replies
View Related
Is there any way to change the following code so that when it's the second last record in the set it doesn't put UNION ALL at the end? Basically, is there a way of saying:
if SecondLastRecord then
I don't know how many records there will be, so I can't count down from 7 or anything.
Code:
View Replies
View Related
Every time I try to ADD a new record from my asp page to SQL table, I got this error:
Microsoft OLE DB Provider for SQL Server (0x80040E2F)
Violation of PRIMARY KEY constraint 'PK_Cancelled_Classes'. Cannot insert duplicate key in object 'Cancelled_Classes'
Here is the Insert statement:
Sql="INSERT INTO Cancelled_Classes (yrtr, cou_id, cancell_date, Message)" sql=sql & " VALUES " sql=sql & "('" & Request.Form("yrtr") & "'," sql=sql & "'" & Request.Form("cou_id") & "'," sql=sql & "'" & Request.Form("cancell_date") & "'," sql=sql & "'" & Request.Form("note") & "')" '
conData.Execute sql
View Replies
View Related
I had a problem that happen once only but i do not want it to repeat
again. It happen when i retrieve data from my database. The process
can't complete and show error 14, Out of string space. I suspect the
recordset object had reach it limit that why it generate that error
message but what can i do to prevent this from happening
View Replies
View Related
I have a siple script where I add a new row in a table which has also a autonumber field. Adding the new row I am trying to get this value of the autonumber field and put it in session, but can not seem to figure out how. I tryed to open a new recordset and pull it out but does not find the record I just added.
View Replies
View Related
The only database connection I have ever made using ASP is to an SQL2000 Server. I was just wondering if someone could provide me with a nice simple script opening a connection and recordset to a MySQL database and providing a valid connection string.
View Replies
View Related
Trying to learn a little asp and am trying to have my form (when the submit button is pressed) put the value in a field in my database. it worked the first time, I typed in the word testing and clicked submit.
now whatever I put in there it creates a new field with the word submit. Can someone tell me what I'm doing wrong here? I'm positive there's something wrong with my code here. Code:
If Request("submit")="Submit Questions" Then
Set questionsubmission=connectionToDatabase.Execute("INSERT INTO kitchen_questions(questions) VALUES('" & database_select("questions") & "')")
End If
View Replies
View Related
I'm looping through a record set and want to treat the first record differently. I've got a counter that I check to determine if its the first iteration through the loop, but I was wondering if there is recordset property that would indicate the record's position in the record set.
View Replies
View Related
now i got all my data in my sql db table (fsearch) . now i want to take the value from the db to display it on the browser in the form of a table .
View Replies
View Related
i need to use the same record set in my page twice. some optimization issue [img]images/smilies/biggrin.gif[/img][img]images/smilies/biggrin.gif[/img]. i have arecord set like this
Code:
set newsrs=createOBject("ADODB.recordSet" )
newsrs.Open newssql,cnn,3,3
and i wanna use this twice in the same page
Code:
do while not newsrs.eof
newsrs.movenext
loop
can any body tell me how? coz when i do it the second isnot working [img]images/smilies/rolleyes.gif[/img]
View Replies
View Related
I run a query like
SQLSelect ="Select Number,Type,Description,Retainage_Percent from table_name1"
this returns a value for number. then I would like to run another query on another db
SQLSelect2 ="Select Number, Text from table_name2 where table_name2.Number = table_name1.Number
View Replies
View Related
I didnt know what to title this, so please bear with me. Trying to learn a little asp and am trying to have my form when the submit button is pressed put the value in a field in my database.
it worked the first time, I typed in the word testing and clicked submit. now whatever I put in there it creates a new field with the word submit. Can someone tell me what I'm doing wrong here? I'm positive there's something wrong with my code here.
Code:
If Request("submit")="Submit Questions" Then
Set questionsubmission=connectionToDatabase.Execute("INSERT INTO kitchen_questions(questions) VALUES('" & database_select("questions") & "')")
End If
View Replies
View Related
how to locate the first record...i sorted the numbers and i want to display the first record based from the query...
View Replies
View Related
i use access database and made add record page and it is added on the database then i made another page to add on another table on the same database it is not working i donot know why,and the problem from me or from the server setting???
View Replies
View Related
iam having problem ,relating to update a column in Access file in ASP
'Change' is column name , rs is recordset object ,and i want to update the values in 'Change' column by return values from a function .Iam using vb script in asp
rs ("Change").value = function()
this is generating error, and won't work
View Replies
View Related
When there are no records for the certain row in my table I recieve this error:
ADODB.Field error '80020009'
Either BOF or EOF is True, or the current record has been deleted. Requested operation requires a current record.
/admin/Fixture.asp, line 0
View Replies
View Related
i am trying to expand the functionality of a page that is running on a
paging script.
i have tried several methods but cant get the results i want
is there an index to a record set that has sequential values (from first to
last) for the rows? if so how do i list it for each record?
View Replies
View Related
I have a page.asp?ID=xyz which redirects to releavant page and works if page exists but gives an error if not a valid page. How do I get it to redirect to an error message page being more user friendly?
View Replies
View Related
I have a bit of ASP that gets data from the database and then displays it. This part works fine.
I then have anouther page to allow for changing this information, then i want to do two things, first show the updated info, and then update it in the database.
Neither of my updates will work and i can't figure out why.
I get this error: ADODB.Recordset error '800a0cb3'
Object or provider is not capable of performing requested operation.
I have checked the record it displays the info just fine, it will not update however. Here is my code for updating the record: Code:
View Replies
View Related
i just wanna know how to be able to update certain fields without touching the others
for example if the form has 3 fields
description, name and age....
if i wanted to update the database from these fields, but only update the description while leaving the ohters as they are, which means blank fields in form...
now if i do that on my form, it will clear other 2 fields in the database and only update the description... how can i fix that so that when there's blank fields in form in won't clear the data in database ?
View Replies
View Related