Limiting Number Of Records
I have built and app where people can add records to a database the problem is while the next page is loading some people are impatient and click refresh adding another same record with slightly different time stamp.
Is there anyway to limit the number of records insterted to my SQL database from my asp pages to one.
View Replies
ADVERTISEMENT
when a form is submitted which takes it to a process page, i have 2 seperate fields called hour and min to insert into a database field, basically what i want to do is run a check on the hour field to make sure it doesnt go higher then 23 if it does, return an error, also with the min field to not go above 59
View Replies
View Related
I'm using the script below to limit a visitor at my site to only be able to post a form 5 times. I believe the reason I've received more e-mails is because the visitor closes their browser then opens a new one and they can post two times each time they do this.
<%
count = Request("count")
if count = "" Then
count = 0
Else
count = count + 1
End If
%>
<%
If count < 5 Then
%>
<a name="step5"></a><input type="submit" name="Submit" value="Submit">
<%
Else
%>
This form has been submitted 5 times. Please contact me for more information.
Can somebody show me how I can do this so it will only work twice within a 24 hour period even if the visitor closes their browser and opens a new one? I would think cookies be the answer to this but what happens if the visitor has cookies turned off? If this would be a good solution can somebody please help me out? I'm not familiar with cookies.
View Replies
View Related
When displaying data from a database, how can I limit how many columns are displayed on the page?
I am trying to build an image gallery, and I want it to be 5 images across by x number of rows. I know how to make each image it's own column, or it's own row, but I don't know how to limit how many columns are displayed per row.
View Replies
View Related
Any build in function that can calculate number of records in a table?
View Replies
View Related
I have a results page which retrieves a number. I am using "Repeat record" to get a list of all the number records of the database.
I would like to make a sum of all these records at the end of the result page.
record1 = 100 (repeat region)
record2 = 500
record3 = 100
and then, how can I make a sum of these records?
Total = 700
View Replies
View Related
how to query data which spesific the number of record from 'start' to the 'end'?let say i have 20 records,then i only wanto to query record from row number 10th to 16th like that.
View Replies
View Related
I just want to return the number of records in a database:
<%
Set cn = Server.CreateObject("ADODB.Connection")
Set rs = Server.CreateObject("ADODB.Recordset")
sql = "SELECT COUNT(*) FROM alumni_baby"
cn.Open ("dsn=mssql;database=web;uid=aaa;pwd=aaa;")
rs.Open sql, cn
%>
<% Response.Write (sql) %>
But that spits out the sql statement, not a number. What am I doing wrong?
View Replies
View Related
I want to know the number of records in my database when performing a query by sql. I am getting -1 as number of records.
<%
connectme="DSN=hotel"
sqltemp="SELECT Count([All Rooms].Engaged) AS CountOfFREEROOM FROM [All Rooms] GROUP BY [All Rooms].Engaged HAVING ((([All Rooms].Engaged)=False));"
set rstemp=Server.CreateObject("adodb.Recordset")
rstemp.open sqltemp, connectme, adopenstatic
howmanyrecs=rstemp.recordcount
response.write howmanyrecs & " records in<br>" & sqltemp
rstemp.close
set rstemp=nothing
%>
my project is on an online hotel reservation. I want to have the number of rooms available each time the page loads.
View Replies
View Related
how do I display only n number of records? then create links to the next set of n?
View Replies
View Related
how can i get a total number of filtered records? what's the code?
View Replies
View Related
i need to go through a list of items and check to see if items on list 1 are on list 2 and vise-versa. so im going to look at item 1 on list 1, and go through all the items on list 2. if i find a match, ill update the record on list 1, if i dont find a match ill update the record on list 2.
im going to need a nested loop. in c++ i know how i could do this, but im not sure as how to do it in vbs/asp. can you do for each "record" in "myrecordset"? or do i have to get the number of records in the table and run the loop that many times? which would be eaister?
View Replies
View Related
I'm trying to set up a "simple" page to display six items at a time in a 2 col x 3 row grid I've succeeded in doing this and displaying all the records but am struggling to only display six at a time I've searched on recordset paging and no one seems to cover this sort of problem Anyone any ideas? Code:
View Replies
View Related
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:
View Replies
View Related
I have an articles_tbl . How do i create a select statement which only brings back the latest 3 records added to this table (the database has a field called 'date_added') so the information of when they were added is present.
I was just wondering how to bring back only THREE records and showing them, instead of bringing back the entire table content and then showing three out of them..
View Replies
View Related
how can i Count and display number of records in table?
View Replies
View Related
I am required to prevent duplicate posts........how can i do this?? my database is MS Access and am using ASP.
Have been scratching my head fo quite some time now........cant figure out the logic.
I understand i cant limit it from the database....if possible i'd like to know how to handle the error that it would give with a page with message
or how can i compare the entry from the database before i post it
View Replies
View Related
I have a database with about two thousand records, and I would like to only display about 50 per page. How would I go about doing this?
I have a hunch it has something to do with the <% Do While not objRS.EOF %> code?
View Replies
View Related
How does one limit the amount of characters being entered into a <textarea>. I know we I can maxlength="50" an <input>, but what about a textarea?
View Replies
View Related
I'm using getrows to speed up data access time, i wonder though if there is a better way. Each recordset returns up to or more than 500 records, this is still quite an overhead for the server when there are lots of people on the site.
Rather than reading all 500 records into the array and then paging the results is it possible to create the recordset with just 25 entries?
ie if you are on page 1 then only the first 25 records are retrieved from the database, page 2 - records 25 - 49 are retrieved etc
or will this slow things down?
View Replies
View Related
I have 40 different users. Each user manages a subset of the total database. Currently I have a pull-down menu to let the user select their subset and then manage the data within it. I'd like to use their login info to pre-select the subset so that they have access only to their assigned areas. How do I "send" the subset name from one asp page to another? the db is "2004" the table is "Students" .
View Replies
View Related
I am looking for a simple way to limit the amount of letters/Characters returned so that it does not throw off my pages styling. Basically I have the following: Code:
<%
Dim SomeVariable
response.write(SomeVariable)
%>
If that SomeVariable has 300 characters in it it will create a very large table that it displays in so, what I want to do is limit it to say 25 or 50 Characters and simply put like .... after it. Any Ideas?
View Replies
View Related
Can anyone please tell me if i can limit the amount session any given user can open at any one time?
View Replies
View Related
I'm developing a page in which different users have different rights within the site. I don't even know where to start with this one because searching for anything to do with "website", "user", "rights", "permissions" or anything along those lines gives me nothing but server file permissions.
What I'm trying to do is allow anybody with a username and password to sign in, then based on their security permissions they will be able to use certain functions of the website. I want all this to be modular though...
I don't want a million IF's in my asp code. What I'm looking for is to have a list of groups, each having a checklist of functions they can perform. Assign a user to a group, and they can do those tasks.
View Replies
View Related
I am able to upload files to my server using free asp upload
software. But i have another requirement now.
#1) I need to let
the user upload files upto 5MB only. Not more.
I need to limit the size of the file.
This is how i am using the file upload.
#2) I have a txtbox and button on my main form. The name of
the button is Upload and when i click on upload button i get
another asp form which has Code:
View Replies
View Related
I need to develop an asp application wich allow users to upload files, but I need to limit every user folder with 10MB.How can I do that?not pure asp solution? each user must be a IIS/FTP user that will control that?
View Replies
View Related
I'm attempting to limit a query which is being ordered by a date field to 10 records. The date field contains duplicate values, which are sorted from most recent, back.
However their suggestion of sorting by a secondary field is not providing acceptable results (it returns all the rows in the database). Does anyone have any suggestions of another way around this?
View Replies
View Related
I am looking to return the first 50 characters from a database field. Does anyone know if there is a SQL function that returns a defined amount of characters from a database field?
View Replies
View Related
I need to insert some number into database as text. My problem is if I insert the number (ie. 4.0), the value in the database only show (4). So, is it possible to convert a real number into text number using ASP?
View Replies
View Related
here is the scenerio
in master batch table i have various master batch like
200701-0001
200701-0002
200701-0003
Now each master batch can have multiple final mixed batch like
200701-0001-01
200701-0001-02
200701-0001-03
and this record is inserted in to fmix table.
so i have a form in which i have a dropdown menu in which all the master batch is listed,
i select 200701-0001 and that value is passed to next page where i will enter other fields data and insertion to my fmix_no will be done automatic like 200701-0001-01, 200701-0001-02 and so on,
how to achieve this
so in short each master batch will have more than one final mixed batch.
pls help, also if u have any online contact in yahoo or msn pls send me, i am so confused and badly struck deadline is just couple of hours away. my yahoo id is(E-Mail address blocked: See forum rules) you can PM me i am online right now.
View Replies
View Related
I want To handel the error messages by myself in one part in my script. I know that in VB I can Use the statment - On error resume next And I also know that I can retrive the Error Number In VB with Err.Number.
How can I handel the errors by myself in ASP? I heard about the ASPErr Object, Is it the same thing like the err object in VB?
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