473,320 Members | 1,821 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Max entries help??

Hi i'm trying to limit the ammount of entries a user can put in the access database, here is my code:
<%
Dim postlimit, total
postlimit = 2 'your lmit that you want
Set rsLimit = Server.CreateObject("ADODB.Recordset")
strSQL = "SELECT [id] FROM table WHERE strGroup ='bob"
rsLimit.Open strSQL, adoCon
total = (rsLimit_total) 'your recordset total
If total => postlimit then
Response.redirect "error.asp"
End If
%>

How ever I know there are 3 entires in the databse with strGroup=bob, so i was wondering can someone give me a clue into what i'm doing wrong?
Aug 18 '07 #1
1 1043
ilearneditonline
130 Expert 100+
Hi i'm trying to limit the ammount of entries a user can put in the access database, here is my code:
<%
Dim postlimit, total
postlimit = 2 'your lmit that you want
Set rsLimit = Server.CreateObject("ADODB.Recordset")
strSQL = "SELECT [id] FROM table WHERE strGroup ='bob"
rsLimit.Open strSQL, adoCon
total = (rsLimit_total) 'your recordset total
If total => postlimit then
Response.redirect "error.asp"
End If
%>

How ever I know there are 3 entires in the databse with strGroup=bob, so i was wondering can someone give me a clue into what i'm doing wrong?
Try this...

Expand|Select|Wrap|Line Numbers
  1.  ' provids a count of records.
  2. strSQL = "SELECT count([id]) as thecount FROM table WHERE strGroup ='bob"
  3. rsLimit.Open strSQL, adoCon 
  4.  
  5. if rsLimit.Fields.Item("thecount").value >= postlimit
  6.  
Aug 18 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

4
by: knoak | last post by:
If a filter with bad words etc. isn't what you mean, you could put an extra field in the DB, called 'OK' or something like that. When someone enters a message in the GB, the initial value of...
2
by: grist2mill | last post by:
I have a table 'Group2Operation' that stores many to many relations between the 'Group' table and the 'Operation' table (each group is has permission to perform one or more of the available...
3
by: andreas.maurer1971 | last post by:
Hi all, since a few years I use the following statement to find duplicate entries in a table: SELECT t1.id, t2.id,... FROM table AS t1 INNER JOIN table AS t2 ON t1.field = t2.field WHERE...
3
by: Ron Eggler | last post by:
hi, I got several entries and two checkboxes and I would like to exchange the entries from one select to the other. like 'Add' and 'Rmove'. Is it possible anyhow? Can anyone help me where to...
10
by: nick_faye | last post by:
Hi guys, i'm still a newbie in using MS Access and in VB programming. I am using DAO connection from my VB to access the entries on my MS Access table. I am having trouble in editting and...
7
by: Jed Parsons | last post by:
Hi, I'm using the logging module for the first time. I'm using it from within Zope Extensions. My problem is that, for every event logged, the logger is producing multiple identical entries...
7
by: Matt | last post by:
I have approximately 5 instances on my test server that are identical to my prod server. On the prod server, when I look at the services file, there is a single entry per instance and everything...
9
by: Suman | last post by:
Happy Friday everyone!!! I am working on a windows service and a C# application and needed some help with certain functionality. Please read through my issue below. Thanks! I have a windows...
1
imrosie
by: imrosie | last post by:
Please help with this one,,,,,I've been trying everything in my arsenal to fix this one. I'm stumped.... I"ve got a unbound combo box (customername) that has two events (on click); AfterUpdate and...
0
by: TechnoAtif | last post by:
<?php include "dbconnect.php"; include "commonFunc.php"; ?> <!----------------------------------> <table width="80%" border="1" cellpadding="2" cellspacing="0"> <tr > <td...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.