joeisbatman
Programmer
Alright, I'm new with ASP. Let me explain the purpose of the site: Its a site that will have many people VIEWING records at the same time. This number viewing will be VERY high, I'm thinking many many thousands (50 thousand??) per day. A much lower number will be actually editing records/ creating new ones.
This in mind I'm really concerned with the effiecncy of the code- I read the FAQ and in it, link9 wrote:
dim rs
set rs = server.createobject (“ADODB.Recordset”)
rs.activeconnection = con
rs.cursortype = adOpenStatic
rs.cursorlocaton = adUseClient
rs.locktype = adLockOptimistic
rs.open “SELECT * FROM myLittleTable”
set rs.activeconnection = nothing
con.close
See that? I just closed the connection, I still have my data, and I've freed up some server resources. If you use a client side cursor, then you don’t even need to keep your active connection. Can you say, “My web site can now support more visitors”?
Currently my code looks like this "
Set connectionToDatabase=Server.CreateObject("ADODB.Connection"
connectionToDatabase.ConnectionTimeout=60 connectionToDatabase.Open "DSN=MyBuddyInfo1"
Set recordSet=Server.CreateObject("ADODB.RecordSet"
recordSet.Open "SELECT * FROM Users_Accounts_A WHERE ID=" &frmID, connectionToDatabase
THEN AT THE VERY BOTTOM OF MY CODE I CLOSE THE DATABASE
connectionToDatabase.Close
set connectionToDatabase=Nothing
Keep in mind, each there aren't many things being pulled from the database in the page, maybe 5 at most, and they'll all be in the same row. WHat I don't understand is is there a way to store the data in a record set then close my connection up top? WOuld this be a good idea? Please note I am very unclear on cursortype/location, but I have a feeling that I want to use a clientside cursor location and close my connection at the top of my code, and then i should still be able to access the record set later. If this is correct could someone type out that code for me, I can't get it to work. And if that isn't correct, please enlighten. Thanks a million
JOE
This in mind I'm really concerned with the effiecncy of the code- I read the FAQ and in it, link9 wrote:
dim rs
set rs = server.createobject (“ADODB.Recordset”)
rs.activeconnection = con
rs.cursortype = adOpenStatic
rs.cursorlocaton = adUseClient
rs.locktype = adLockOptimistic
rs.open “SELECT * FROM myLittleTable”
set rs.activeconnection = nothing
con.close
See that? I just closed the connection, I still have my data, and I've freed up some server resources. If you use a client side cursor, then you don’t even need to keep your active connection. Can you say, “My web site can now support more visitors”?
Currently my code looks like this "
Set connectionToDatabase=Server.CreateObject("ADODB.Connection"
connectionToDatabase.ConnectionTimeout=60 connectionToDatabase.Open "DSN=MyBuddyInfo1"
Set recordSet=Server.CreateObject("ADODB.RecordSet"
recordSet.Open "SELECT * FROM Users_Accounts_A WHERE ID=" &frmID, connectionToDatabase
THEN AT THE VERY BOTTOM OF MY CODE I CLOSE THE DATABASE
connectionToDatabase.Close
set connectionToDatabase=Nothing
Keep in mind, each there aren't many things being pulled from the database in the page, maybe 5 at most, and they'll all be in the same row. WHat I don't understand is is there a way to store the data in a record set then close my connection up top? WOuld this be a good idea? Please note I am very unclear on cursortype/location, but I have a feeling that I want to use a clientside cursor location and close my connection at the top of my code, and then i should still be able to access the record set later. If this is correct could someone type out that code for me, I can't get it to work. And if that isn't correct, please enlighten. Thanks a million
JOE