I found a site that was quite helpfull in teaching me how to work an ado function on
my site here is the address:
http://authors.aspalliance.com/aspxtreme/ado/index.aspx .Hope it helps anyone who
needs help with asp ado stuff.
----- Original Message -----
From: pfrenchy
To: [EMAIL PROTECTED]
Sent: Wednesday, May 12, 2004 2:40 PM
Subject: Re: [AspClassicAnyQuestionIsOk] move next one record at a time
Your on to something there.
the clone database keeps the records on it as well but when the admin submits it
there is a yes no field that is checked so if the admin pushes next or back it will
only show field where the check box is false if it has been submitted to main it will
come up as true. The database I am building is for certifying truckers to haul
hazardous materials. Kind of like a registry office when you get your license renewed
or the plates on your car. Truck companies and testers need to search this database
but I don't want them to have full access and that's why the clone database. When a
user logs in I collect there ID which allows me to know who they work for and if they
are testers or companies registering drivers testers can see all driver records
companies can only see records entered by there company.(ps all this is working right
now without the ado type functions.)SQL= "Select * from MyDatabase where
MyDatabase.Submited=False" Kinda like this
objConnection4.open ' Declared in and include file
Set objrsRec = Server.CreateObject("ADODB.Recordset")
strSQL= "Select * from MyDatabase where MyDatabase.Submited=False"
objrsRec.Open strSQL,objConn4, 2, 3
Dim intcounter
intcounter = 0
Do WHile Not objrsRec.EOF
if objrsRec.Fields("Submited") = false then
intcounter = intcounter +1 ' Now i have my record count which i
assume i will need for my delete, next and back buttons
session("Counter") = intcounter
else
objrsRec.MoveNext
end if
Loop
with objrsRec
objrsRec.MoveFirst
load record set to my session variables
end with
response.redirect "Myform.asp" ' Myform collects session Variables and loads
there value in the appropriat fields via value="<% response.write
session("MysessionVariable") %>"
Now i would like to have a delete, next and back button ado function to go threw the
records where submitted = false
When i submit a record it updates the record and loads it back to the form to give
the user one more chance at making anychanges. Via a Submit.asp Page I assume I will
need a Delete Function, Next Function and Back Function on this page as well. I am
just not sure how to count the records to make sure it goes to the correct one each
time. And how to tell which button was clicked.
Now i would like to have a delete, next and back button ado function to go threw the
records where submitted = false
----- Original Message -----
From: Mark E
To: [EMAIL PROTECTED]
Sent: Wednesday, May 12, 2004 11:35 AM
Subject: Re: [AspClassicAnyQuestionIsOk] move next one record at a time
pfrenchy,
OK, I will take a stab at this:
1) Admin clicks on a "GetUnapprovedDetails.asp".
2) GetUnapprovedDetails.asp has a sql statment like "select max(ID), Name, Date
from leavepending".
3) Check recordset for a record. If found, display the details. If not, display
"no pending records to display". Or something like that.
4) If there was a record from step 3, display the data on the form for approval.
Then, take this ID, build and execute the following SQL: select max(ID), Name, Date
from leavepending where ID <> " & intID
5) Check for a record. If one is found, dynamically display a next link calling
this same page. If no record is found, do nothing as there are no more records.
6) Admin submits the form to itself, updating the record and it gets removed from
the clone database and goes to the main database. Then the page again starts at step 1.
Now, I just typed this as I was going along, so I might have missed some things.
But it's a start.
An alternative would be to create a page that lists each record pending approval
and make the admin always go to this page & drill down to see & approve the record.
It's much easier to create, but you would loose the "next record" feature.
Mark
pfrenchy <[EMAIL PROTECTED]> wrote:
Hum I read my message sorry it is not clear it was real late when I wrote it. I
have a clone database to catch web entries it holds the same info as the main
database. when a user enters a record I don't want them to be able to slap it in the
main without an admin verifying the info. So what I have done is put a checkbox called
submit to main on the admin form. The admin loads the form from the database it loads
all records that have not been submitted to main(where chkSubmit = false). When the
admin verifies that the record is indeed ok he puts a check in the chkSubmit box then
submits the record there for it should disappear out of the ado collection. I agree
that ado is intense on the server so I would like to hook up to the database and
retrieve records each time the next, back, submit or delete buttons are clicked. There
are never going to be more than 2 admins doing this at a time and probably only 20 to
30 records entered a day for now. It is possible that this number grows
in the future at which point this Pentium 3 550 server isn't going to cut it but
for now it works. I know how to make the buttons work but I am not sure how to get the
record number for the move next move back and such. When the admin hits the submit
button it calls the submit page and inserts into the web database and also into main
database. the Admin form is renewed and the submitted record is not there so the next
one to be submitted is. My dilemma is that two groups make entries on forms one
registers a user the user does tests and the test center completes the form once tests
are passed. So when the admin is checking entries some will not be submitted and some
will so the back and next button come into play. I have two forms that will do this
and they are both nasty with about 69 entries on each one. Just to make things worse
one of the forms has editable listboxes(about 9 of them) and I have to make sure
entries aren't entered for nothing from those boxes so I have to check
if the record was manually typed or if it is in the database each time. Hope this
is a better explanation.
----- Original Message -----
From: Mark E
To: [EMAIL PROTECTED]
Sent: Wednesday, May 12, 2004 5:19 AM
Subject: Re: [AspClassicAnyQuestionIsOk] move next one record at a time
pfrenchy,
I don't actually work with an ADO recordset. It's server-side and too resource
intensive to maintain. Think of it more as working with a single record with the
ability to get the first, previous, next and last record on the fly.
Anyhow, I don't I fully understand what you are trying to do.
I understand the part about moving through the records. But what do you mean by
after you submit the entry you do not want it to appear in your ado any more?
Sorry, it's early and I haven't finished my first cup of coffee. So forgive me
if this is obvious!
Mark
pfrenchy <[EMAIL PROTECTED]> wrote:
Hey Mark E is there anyway you could post some sample code to create an ado
connection. I as well am trying to go threw records. My dilemma is that in my admin
portion I want to go threw my web database and verify entries before I submit them to
my main database. When I am going threw records and I am satisfied with the entry I
will check a box then hit a submit button once I do this I don't want this record to
appear in my ado any more. I would like a( back , next ,delete button on this ado )
and my submit button to insert into my main database. Is this even possible. Any
enlightenment on this would be a great help.
[Non-text portions of this message have been removed]
Yahoo! Groups Sponsor
ADVERTISEMENT
------------------------------------------------------------------------------
Yahoo! Groups Links
a.. To visit your group on the web, go to:
http://groups.yahoo.com/group/AspClassicAnyQuestionIsOk/
b.. To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
c.. Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.
[Non-text portions of this message have been removed]
------------------------ Yahoo! Groups Sponsor ---------------------~-->
Yahoo! Domains - Claim yours for only $14.70
http://us.click.yahoo.com/Z1wmxD/DREIAA/yQLSAA/saFolB/TM
---------------------------------------------------------------------~->
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/AspClassicAnyQuestionIsOk/
<*> To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/