473,320 Members | 1,694 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.

class -session variable

Hi,
I want to do things this way:

I have a bunch of stuff that I want to keep track of while a user is
connected to the site. Maybe 50 little peices of information.

So I know I can make 50 session variables , or an store an array in a
session variable, but what I wanna do is store it all in a class
so I can use property get and property let.

I want to store this class in a session variable so I don't lose my info
everytime the page is changed.

Good Idea or not??
Jul 19 '05 #1
15 4354
Why don't you store the info in a database, and all you have to store in the
session is the primary key...

<fe**@fro.com> wrote in message
news:eU**************@TK2MSFTNGP12.phx.gbl...
Hi,
I want to do things this way:

I have a bunch of stuff that I want to keep track of while a user is
connected to the site. Maybe 50 little peices of information.

So I know I can make 50 session variables , or an store an array in a
session variable, but what I wanna do is store it all in a class
so I can use property get and property let.

I want to store this class in a session variable so I don't lose my info
everytime the page is changed.

Good Idea or not??

Jul 19 '05 #2
>You would still have to store the class instance in a session variable .
That';s what I wanna do. I am just asking is it possible. I guess it must
be thanks. So I'll do it.
Your users can still whiz around your site if you just get it from the DB each page.

I don't wanna do that, I've done that for years. gotta be a better way

thanks
"Bob Lehmann" <no****@dontbotherme.zzz> wrote in message
news:e7****************@TK2MSFTNGP12.phx.gbl... You would still have to store the class instance in a session variable .
Your users can still whiz around your site if you just get it from the DB
each page.

Bob Lehmann

"Tammy B." <Tb@stinkylips.com> wrote in message
news:%2****************@tk2msftngp13.phx.gbl...
Hi I am storing tons of info in a database.
It's all in a database. I just want to get the info once and let the user
whiz around the site with out having to look it up again on every page.

I could store it all in session varables, but it seems even better to

write
a class in an include file, and use property let and property set to
retrieve what I need.

Have you seen this before?

"Aaron Bertrand - MVP" <aa***@TRASHaspfaq.com> wrote in message
news:OK****************@tk2msftngp13.phx.gbl...
Why don't you store the info in a database, and all you have to store in
the
session is the primary key...

<fe**@fro.com> wrote in message
news:eU**************@TK2MSFTNGP12.phx.gbl...
> Hi,
> I want to do things this way:
>
> I have a bunch of stuff that I want to keep track of while a user is
> connected to the site. Maybe 50 little peices of information.
>
> So I know I can make 50 session variables , or an store an array in

a > session variable, but what I wanna do is store it all in a class
> so I can use property get and property let.
>
> I want to store this class in a session variable so I don't lose my

info > everytime the page is changed.
>
> Good Idea or not??
>
>



Jul 19 '05 #3
> You would still have to store the class instance in a session variable .
Your users can still whiz around your site if you just get it from the DB
each page.


And I contend that using the DB would almost surely be more efficient, given
correct indexing and cleanup of obsolete data...
Jul 19 '05 #4
good to know.
And I contend that using the DB would almost surely be more efficient, given correct indexing and cleanup of obsolete data...
Ok what I am doing is close to a shopping basket.

Here's an example. Basically, if the session variable exists then use it,
otherwise go look it up.
Saves a trip to the database if not needed.
But it would be simpler to just have Current_vendor_name be a property of a
class.

Response.write getCurrent_VENDOR_NAME()

function getCurrent_VENDOR_NAME
if session("Current_VENDOR_NAME")="" then 'if session variable does not
exist then go look it up
sql = " Select VENDOR_NAME from user_settings where username='" &
getusername() & "'"
getrecordset(sql)
session("Current_VENDOR_NAME") =rs(0)
else
'if session variable does exist then do nothing
end if
getCurrent_VENDOR_NAME= session("Current_VENDOR_NAME") 'return the
session variable
end function


"Aaron Bertrand - MVP" <aa***@TRASHaspfaq.com> wrote in message
news:ue****************@TK2MSFTNGP12.phx.gbl...
You would still have to store the class instance in a session variable .
Your users can still whiz around your site if you just get it from the DB each page.


And I contend that using the DB would almost surely be more efficient,

given correct indexing and cleanup of obsolete data...

Jul 19 '05 #5
I would certainly consider caching this data locally on the server rather
than going back and forth to the database for it. I don't know if you'll be
able to store a class in Session or not, so I won't comment on that.

Have you considered using an xml document? You could save it to an xml file
instead of using Session, which has some drawbacks, especially if the user
is rejecting cookies.

Bob Barrows

Tammy B. wrote:
good to know.
And I contend that using the DB would almost surely be more
efficient, given correct indexing and cleanup of obsolete data...


Ok what I am doing is close to a shopping basket.

Here's an example. Basically, if the session variable exists then
use it, otherwise go look it up.
Saves a trip to the database if not needed.
But it would be simpler to just have Current_vendor_name be a
property of a class.

Response.write getCurrent_VENDOR_NAME()

function getCurrent_VENDOR_NAME
if session("Current_VENDOR_NAME")="" then 'if session variable
does not exist then go look it up
sql = " Select VENDOR_NAME from user_settings where
username='" & getusername() & "'"
getrecordset(sql)
session("Current_VENDOR_NAME") =rs(0)
else
'if session variable does exist then do nothing
end if
getCurrent_VENDOR_NAME= session("Current_VENDOR_NAME")
'return the session variable
end function


"Aaron Bertrand - MVP" <aa***@TRASHaspfaq.com> wrote in message
news:ue****************@TK2MSFTNGP12.phx.gbl...
You would still have to store the class instance in a session
variable . Your users can still whiz around your site if you just
get it from the DB each page.


And I contend that using the DB would almost surely be more
efficient, given correct indexing and cleanup of obsolete data...

Jul 19 '05 #6
Good idea. Probably the best Idea yet.
I am not there mentally yet, else I would not be pitchfork fighting in
Arron Bertrand hell right now.

He doesn't know if I'll be able to store a class in Session either.
Thank you.
"Bob Barrows" <re*******@yahoo.com> wrote in message
news:ex**************@TK2MSFTNGP12.phx.gbl...
I would certainly consider caching this data locally on the server rather
than going back and forth to the database for it. I don't know if you'll be able to store a class in Session or not, so I won't comment on that.

Have you considered using an xml document? You could save it to an xml file instead of using Session, which has some drawbacks, especially if the user
is rejecting cookies.

Bob Barrows

Tammy B. wrote:
good to know.
And I contend that using the DB would almost surely be more
efficient, given correct indexing and cleanup of obsolete data...


Ok what I am doing is close to a shopping basket.

Here's an example. Basically, if the session variable exists then
use it, otherwise go look it up.
Saves a trip to the database if not needed.
But it would be simpler to just have Current_vendor_name be a
property of a class.

Response.write getCurrent_VENDOR_NAME()

function getCurrent_VENDOR_NAME
if session("Current_VENDOR_NAME")="" then 'if session variable
does not exist then go look it up
sql = " Select VENDOR_NAME from user_settings where
username='" & getusername() & "'"
getrecordset(sql)
session("Current_VENDOR_NAME") =rs(0)
else
'if session variable does exist then do nothing
end if
getCurrent_VENDOR_NAME= session("Current_VENDOR_NAME")
'return the session variable
end function


"Aaron Bertrand - MVP" <aa***@TRASHaspfaq.com> wrote in message
news:ue****************@TK2MSFTNGP12.phx.gbl...
You would still have to store the class instance in a session
variable . Your users can still whiz around your site if you just
get it from the DB each page.

And I contend that using the DB would almost surely be more
efficient, given correct indexing and cleanup of obsolete data...


Jul 19 '05 #7
> He doesn't know if I'll be able to store a class in Session either.

Have you thought of, hmmm, I don't know, TRYING IT?
Jul 19 '05 #8
Well, seeing as how I'm on a roll ... :-)

For that matter, you can also use a disconnected recordset, which can also
be saved to a file and reopened as necessary. It can even be reconnected to
the database so any changes can be propogated to the database using
UpdateBatch.

HTH,
Bob Barrows

Tammy B. wrote:
Good idea. Probably the best Idea yet.
I am not there mentally yet, else I would not be pitchfork fighting
in Arron Bertrand hell right now.

He doesn't know if I'll be able to store a class in Session either.
Thank you.
"Bob Barrows" <re*******@yahoo.com> wrote in message
news:ex**************@TK2MSFTNGP12.phx.gbl...
I would certainly consider caching this data locally on the server
rather than going back and forth to the database for it. I don't
know if you'll be able to store a class in Session or not, so I
won't comment on that.

Have you considered using an xml document? You could save it to an
xml file instead of using Session, which has some drawbacks,
especially if the user is rejecting cookies.

Bob Barrows

Tammy B. wrote:
good to know.

And I contend that using the DB would almost surely be more
efficient, given correct indexing and cleanup of obsolete data...

Ok what I am doing is close to a shopping basket.

Here's an example. Basically, if the session variable exists then
use it, otherwise go look it up.
Saves a trip to the database if not needed.
But it would be simpler to just have Current_vendor_name be a
property of a class.

Response.write getCurrent_VENDOR_NAME()

function getCurrent_VENDOR_NAME
if session("Current_VENDOR_NAME")="" then 'if session variable
does not exist then go look it up
sql = " Select VENDOR_NAME from user_settings where
username='" & getusername() & "'"
getrecordset(sql)
session("Current_VENDOR_NAME") =rs(0)
else
'if session variable does exist then do nothing
end if
getCurrent_VENDOR_NAME= session("Current_VENDOR_NAME")
'return the session variable
end function


"Aaron Bertrand - MVP" <aa***@TRASHaspfaq.com> wrote in message
news:ue****************@TK2MSFTNGP12.phx.gbl...
> You would still have to store the class instance in a session
> variable . Your users can still whiz around your site if you just
> get it from the DB each page.

And I contend that using the DB would almost surely be more
efficient, given correct indexing and cleanup of obsolete data...

Jul 19 '05 #9
I did, but I can't get it to work.
So I need to know if it is something I am doing wrong , or if it is not
possible. That's why I to get someone WHO KNOWS to answer the question, and
to get YOU to STEP ASIDE

Will you keep me in your kill file
ps. have a good weekend

"Aaron Bertrand - MVP" <aa***@TRASHaspfaq.com> wrote in message
news:u6**************@tk2msftngp13.phx.gbl...
He doesn't know if I'll be able to store a class in Session either.


Have you thought of, hmmm, I don't know, TRYING IT?

Jul 19 '05 #10
holy moly that sounds good, I thought i was using a disconnected recordset.

save to what kind of file? text? xml? a recordset file? where on the client?
server?
"Bob Barrows" <re*******@yahoo.com> wrote in message
news:u$**************@TK2MSFTNGP12.phx.gbl...
Well, seeing as how I'm on a roll ... :-)

For that matter, you can also use a disconnected recordset, which can also
be saved to a file and reopened as necessary. It can even be reconnected to the database so any changes can be propogated to the database using
UpdateBatch.

HTH,
Bob Barrows

Tammy B. wrote:
Good idea. Probably the best Idea yet.
I am not there mentally yet, else I would not be pitchfork fighting
in Arron Bertrand hell right now.

He doesn't know if I'll be able to store a class in Session either.
Thank you.
"Bob Barrows" <re*******@yahoo.com> wrote in message
news:ex**************@TK2MSFTNGP12.phx.gbl...
I would certainly consider caching this data locally on the server
rather than going back and forth to the database for it. I don't
know if you'll be able to store a class in Session or not, so I
won't comment on that.

Have you considered using an xml document? You could save it to an
xml file instead of using Session, which has some drawbacks,
especially if the user is rejecting cookies.

Bob Barrows

Tammy B. wrote:
good to know.

> And I contend that using the DB would almost surely be more
> efficient, given correct indexing and cleanup of obsolete data...

Ok what I am doing is close to a shopping basket.

Here's an example. Basically, if the session variable exists then
use it, otherwise go look it up.
Saves a trip to the database if not needed.
But it would be simpler to just have Current_vendor_name be a
property of a class.

Response.write getCurrent_VENDOR_NAME()

function getCurrent_VENDOR_NAME
if session("Current_VENDOR_NAME")="" then 'if session variable
does not exist then go look it up
sql = " Select VENDOR_NAME from user_settings where
username='" & getusername() & "'"
getrecordset(sql)
session("Current_VENDOR_NAME") =rs(0)
else
'if session variable does exist then do nothing
end if
getCurrent_VENDOR_NAME= session("Current_VENDOR_NAME")
'return the session variable
end function


"Aaron Bertrand - MVP" <aa***@TRASHaspfaq.com> wrote in message
news:ue****************@TK2MSFTNGP12.phx.gbl...
>> You would still have to store the class instance in a session
>> variable . Your users can still whiz around your site if you just
>> get it from the DB each page.
>
> And I contend that using the DB would almost surely be more
> efficient, given correct indexing and cleanup of obsolete data...


Jul 19 '05 #11
Tammy B. wrote:
holy moly that sounds good, I thought i was using a disconnected
recordset.
You only have a disconnected recordset if you've opened it and subsequently
set its ActiveConnection property to Nothing (which explains its name ...)

save to what kind of file? text? xml? a recordset file? Either a proprietary recordset format file, or an xml file. See here:
http://msdn.microsoft.com/library/en...damth03_10.asp

where on the client? server?
I was thinking of saving it on the server. You won't be able to save a file
on the client machine due to security reasons, unless you go the HTA route
(HTML Application).

If you want to pass the recordset to the client page, you can do something
like this:

http://www.davidpenton.com/testsite/...ver2client.asp

If you change the recordset in client-side code (add or change data, that
is), passing the changed recordset back to a server-side page would require
saving it to an xml document and putting the xml document's xml into a
hidden textbox ... I've never done this part so I'm making this up as I go
.... :-) I don't see why it wouldn't work ...

Of course, the client machine will have to have a functioning MDAC
installation in order for any of this client-side stuff to work. This alone
may be enough to convince you to do ADO stuff on the server only.

It's a lot easier to pass an xml document to the client. See here:
http://www.davidpenton.com/testsite/...ta.islands.asp

HTH,
Bob Barrows



"Bob Barrows" <re*******@yahoo.com> wrote in message
news:u$**************@TK2MSFTNGP12.phx.gbl...
Well, seeing as how I'm on a roll ... :-)

For that matter, you can also use a disconnected recordset, which
can also be saved to a file and reopened as necessary. It can even
be reconnected to the database so any changes can be propogated to
the database using UpdateBatch.

HTH,
Bob Barrows

Tammy B. wrote:
Good idea. Probably the best Idea yet.
I am not there mentally yet, else I would not be pitchfork
fighting in Arron Bertrand hell right now.

He doesn't know if I'll be able to store a class in Session either.
Thank you.
"Bob Barrows" <re*******@yahoo.com> wrote in message
news:ex**************@TK2MSFTNGP12.phx.gbl...
I would certainly consider caching this data locally on the server
rather than going back and forth to the database for it. I don't
know if you'll be able to store a class in Session or not, so I
won't comment on that.

Have you considered using an xml document? You could save it to an
xml file instead of using Session, which has some drawbacks,
especially if the user is rejecting cookies.

Bob Barrows

Tammy B. wrote:
> good to know.
>
>> And I contend that using the DB would almost surely be more
>> efficient, given correct indexing and cleanup of obsolete data...
>
> Ok what I am doing is close to a shopping basket.
>
> Here's an example. Basically, if the session variable exists then
> use it, otherwise go look it up.
> Saves a trip to the database if not needed.
> But it would be simpler to just have Current_vendor_name be a
> property of a class.
>
> Response.write getCurrent_VENDOR_NAME()
>
> function getCurrent_VENDOR_NAME
> if session("Current_VENDOR_NAME")="" then 'if session
> variable does not exist then go look it up
> sql = " Select VENDOR_NAME from user_settings where
> username='" & getusername() & "'"
> getrecordset(sql)
> session("Current_VENDOR_NAME") =rs(0)
> else
> 'if session variable does exist then do nothing
> end if
> getCurrent_VENDOR_NAME= session("Current_VENDOR_NAME")
> 'return the session variable
> end function
>
>
>
>
> "Aaron Bertrand - MVP" <aa***@TRASHaspfaq.com> wrote in message
> news:ue****************@TK2MSFTNGP12.phx.gbl...
>>> You would still have to store the class instance in a session
>>> variable . Your users can still whiz around your site if you
>>> just get it from the DB each page.
>>
>> And I contend that using the DB would almost surely be more
>> efficient, given correct indexing and cleanup of obsolete data...

Jul 19 '05 #12
I may be wrong but I believe that VBScript classes cannot be stored in
session variables (sort of remember a Michael Harris post).
Also discussed here:
http://aspfaqs.com/aspfaqs/ShowFAQ.asp?FAQID=195

A lot of the possibilitites discussed here seem a bit overly complex?

Here's my list of possible solutions:
An XML document (stored as a single string session variable) would do the
trick.
A WSC component (eg. same as a DLL but scripted code and no requirement to
recompile to make change) that either stores the data in session variable(s)
or a database. WSC's expose intellisense etc. to Interdev so they are a
slightly more complex version of VBScript classes that are also COM objects
in their own right.
A simple state VB DLL would also suffice (before I get flamed - I know there
are a multitiude of issues with *VB* DLLs in that they are apartment
threaded and give rise to all sorts of scaleability issues).
A stateless VB DLL (or hosted in MTS would be better) that stores and
retrieves from a database.
Data stored diretly in a database.

All of them have issues mostly concerning complexity, state management and
scaleability.

The simplest in my mind to achieve the required results would be an XML
document with the XML string stored in a single session variable (or
database for that matter). Also has the added benefit that it can be
communicated with from the client side (with client side XML support of
course).

Anyway - that's my meagre thoughts.

Cheers,

Chris.

"Tammy B." <Tb@stinkylips.com> wrote in message
news:ec**************@TK2MSFTNGP10.phx.gbl...
I did, but I can't get it to work.
So I need to know if it is something I am doing wrong , or if it is not
possible. That's why I to get someone WHO KNOWS to answer the question, and to get YOU to STEP ASIDE

Will you keep me in your kill file
ps. have a good weekend

"Aaron Bertrand - MVP" <aa***@TRASHaspfaq.com> wrote in message
news:u6**************@tk2msftngp13.phx.gbl...
He doesn't know if I'll be able to store a class in Session either.


Have you thought of, hmmm, I don't know, TRYING IT?


Jul 19 '05 #13
Tammy B. wrote:
ok so I'm doing that. so I guess i need to save it as <another>
diconnected recordset - as a file ..?

? Another recordset?
No. Just save your disconnected recordset to a file. You'll have to use some
sort of naming scheme so you can identify the proper file. When the next
page opens, create a recordset object, check to see if the file exists. If
it does, instead of using a database connection to open it, use the file's
name in the Open statement. I think I posted an example of doing this in the
past week. Off to Google .... Here it is:
http://tinyurl.com/fz9p

HTH,
Bob Barrows
Jul 19 '05 #14
See the following:

http://msdn.microsoft.com/library/de...es_vb02_17.asp

I also have a VB class that retrieves disconnected recordsets - see the
ADODBFunctions class in:
http://ftp.belper.blue-canoe.net/rsaccess/rsaccess.zip

Chris.

"Tammy B." <Tb@stinkylips.com> wrote in message
news:u9**************@TK2MSFTNGP10.phx.gbl...
ok so I'm doing that. so I guess i need to save it as <another> diconnected recordset - as a file ..?
"Bob Barrows" <re*******@yahoo.com> wrote in message
news:Og**************@TK2MSFTNGP12.phx.gbl...
Tammy B. wrote:
holy moly that sounds good, I thought i was using a disconnected
recordset.


You only have a disconnected recordset if you've opened it and

subsequently
set its ActiveConnection property to Nothing (which explains its name ....)

save to what kind of file? text? xml? a recordset file?

Either a proprietary recordset format file, or an xml file. See here:
http://msdn.microsoft.com/library/en...damth03_10.asp

where on the
client? server?


I was thinking of saving it on the server. You won't be able to save a

file
on the client machine due to security reasons, unless you go the HTA route (HTML Application).

If you want to pass the recordset to the client page, you can do something like this:

http://www.davidpenton.com/testsite/...ver2client.asp

If you change the recordset in client-side code (add or change data, that is), passing the changed recordset back to a server-side page would

require
saving it to an xml document and putting the xml document's xml into a
hidden textbox ... I've never done this part so I'm making this up as I go ... :-) I don't see why it wouldn't work ...

Of course, the client machine will have to have a functioning MDAC
installation in order for any of this client-side stuff to work. This

alone
may be enough to convince you to do ADO stuff on the server only.

It's a lot easier to pass an xml document to the client. See here:
http://www.davidpenton.com/testsite/...ta.islands.asp

HTH,
Bob Barrows



"Bob Barrows" <re*******@yahoo.com> wrote in message
news:u$**************@TK2MSFTNGP12.phx.gbl...
> Well, seeing as how I'm on a roll ... :-)
>
> For that matter, you can also use a disconnected recordset, which
> can also be saved to a file and reopened as necessary. It can even
> be reconnected to the database so any changes can be propogated to
> the database using UpdateBatch.
>
> HTH,
> Bob Barrows
>
> Tammy B. wrote:
>> Good idea. Probably the best Idea yet.
>> I am not there mentally yet, else I would not be pitchfork
>> fighting in Arron Bertrand hell right now.
>>
>> He doesn't know if I'll be able to store a class in Session either.
>> Thank you.
>>
>>
>> "Bob Barrows" <re*******@yahoo.com> wrote in message
>> news:ex**************@TK2MSFTNGP12.phx.gbl...
>>> I would certainly consider caching this data locally on the server
>>> rather than going back and forth to the database for it. I don't
>>> know if you'll be able to store a class in Session or not, so I
>>> won't comment on that.
>>>
>>> Have you considered using an xml document? You could save it to an
>>> xml file instead of using Session, which has some drawbacks,
>>> especially if the user is rejecting cookies.
>>>
>>> Bob Barrows
>>>
>>> Tammy B. wrote:
>>>> good to know.
>>>>
>>>>> And I contend that using the DB would almost surely be more
>>>>> efficient, given correct indexing and cleanup of obsolete data...
>>>>
>>>> Ok what I am doing is close to a shopping basket.
>>>>
>>>> Here's an example. Basically, if the session variable exists then
>>>> use it, otherwise go look it up.
>>>> Saves a trip to the database if not needed.
>>>> But it would be simpler to just have Current_vendor_name be a
>>>> property of a class.
>>>>
>>>> Response.write getCurrent_VENDOR_NAME()
>>>>
>>>> function getCurrent_VENDOR_NAME
>>>> if session("Current_VENDOR_NAME")="" then 'if session
>>>> variable does not exist then go look it up
>>>> sql = " Select VENDOR_NAME from user_settings where
>>>> username='" & getusername() & "'"
>>>> getrecordset(sql)
>>>> session("Current_VENDOR_NAME") =rs(0)
>>>> else
>>>> 'if session variable does exist then do nothing
>>>> end if
>>>> getCurrent_VENDOR_NAME= session("Current_VENDOR_NAME")
>>>> 'return the session variable
>>>> end function
>>>>
>>>>
>>>>
>>>>
>>>> "Aaron Bertrand - MVP" <aa***@TRASHaspfaq.com> wrote in message
>>>> news:ue****************@TK2MSFTNGP12.phx.gbl...
>>>>>> You would still have to store the class instance in a session
>>>>>> variable . Your users can still whiz around your site if you
>>>>>> just get it from the DB each page.
>>>>>
>>>>> And I contend that using the DB would almost surely be more
>>>>> efficient, given correct indexing and cleanup of obsolete data...



Jul 19 '05 #15
wahooo thanks guys

"Chris Barber" <ch***@blue-canoe.co.uk.NOSPAM> wrote in message
news:On**************@TK2MSFTNGP12.phx.gbl...
See the following:

http://msdn.microsoft.com/library/de...es_vb02_17.asp
I also have a VB class that retrieves disconnected recordsets - see the
ADODBFunctions class in:
http://ftp.belper.blue-canoe.net/rsaccess/rsaccess.zip

Chris.

"Tammy B." <Tb@stinkylips.com> wrote in message
news:u9**************@TK2MSFTNGP10.phx.gbl...
ok so I'm doing that. so I guess i need to save it as <another> diconnected
recordset - as a file ..?
"Bob Barrows" <re*******@yahoo.com> wrote in message
news:Og**************@TK2MSFTNGP12.phx.gbl...
Tammy B. wrote:
> holy moly that sounds good, I thought i was using a disconnected
> recordset.

You only have a disconnected recordset if you've opened it and

subsequently
set its ActiveConnection property to Nothing (which explains its name ...)
>
> save to what kind of file? text? xml? a recordset file?
Either a proprietary recordset format file, or an xml file. See here:
http://msdn.microsoft.com/library/en...damth03_10.asp

where on the
> client? server?

I was thinking of saving it on the server. You won't be able to save a

file
on the client machine due to security reasons, unless you go the HTA route (HTML Application).

If you want to pass the recordset to the client page, you can do something like this:

http://www.davidpenton.com/testsite/...ver2client.asp
If you change the recordset in client-side code (add or change data, that is), passing the changed recordset back to a server-side page would

require
saving it to an xml document and putting the xml document's xml into a
hidden textbox ... I've never done this part so I'm making this up as I go
... :-) I don't see why it wouldn't work ...

Of course, the client machine will have to have a functioning MDAC
installation in order for any of this client-side stuff to work. This

alone
may be enough to convince you to do ADO stuff on the server only.

It's a lot easier to pass an xml document to the client. See here:
http://www.davidpenton.com/testsite/...ta.islands.asp

HTH,
Bob Barrows
>
>
> "Bob Barrows" <re*******@yahoo.com> wrote in message
> news:u$**************@TK2MSFTNGP12.phx.gbl...
>> Well, seeing as how I'm on a roll ... :-)
>>
>> For that matter, you can also use a disconnected recordset, which
>> can also be saved to a file and reopened as necessary. It can even
>> be reconnected to the database so any changes can be propogated to
>> the database using UpdateBatch.
>>
>> HTH,
>> Bob Barrows
>>
>> Tammy B. wrote:
>>> Good idea. Probably the best Idea yet.
>>> I am not there mentally yet, else I would not be pitchfork
>>> fighting in Arron Bertrand hell right now.
>>>
>>> He doesn't know if I'll be able to store a class in Session

either. >>> Thank you.
>>>
>>>
>>> "Bob Barrows" <re*******@yahoo.com> wrote in message
>>> news:ex**************@TK2MSFTNGP12.phx.gbl...
>>>> I would certainly consider caching this data locally on the server >>>> rather than going back and forth to the database for it. I don't
>>>> know if you'll be able to store a class in Session or not, so I
>>>> won't comment on that.
>>>>
>>>> Have you considered using an xml document? You could save it to an >>>> xml file instead of using Session, which has some drawbacks,
>>>> especially if the user is rejecting cookies.
>>>>
>>>> Bob Barrows
>>>>
>>>> Tammy B. wrote:
>>>>> good to know.
>>>>>
>>>>>> And I contend that using the DB would almost surely be more
>>>>>> efficient, given correct indexing and cleanup of obsolete data... >>>>>
>>>>> Ok what I am doing is close to a shopping basket.
>>>>>
>>>>> Here's an example. Basically, if the session variable exists then >>>>> use it, otherwise go look it up.
>>>>> Saves a trip to the database if not needed.
>>>>> But it would be simpler to just have Current_vendor_name be a
>>>>> property of a class.
>>>>>
>>>>> Response.write getCurrent_VENDOR_NAME()
>>>>>
>>>>> function getCurrent_VENDOR_NAME
>>>>> if session("Current_VENDOR_NAME")="" then 'if session
>>>>> variable does not exist then go look it up
>>>>> sql = " Select VENDOR_NAME from user_settings where
>>>>> username='" & getusername() & "'"
>>>>> getrecordset(sql)
>>>>> session("Current_VENDOR_NAME") =rs(0)
>>>>> else
>>>>> 'if session variable does exist then do nothing
>>>>> end if
>>>>> getCurrent_VENDOR_NAME= session("Current_VENDOR_NAME")
>>>>> 'return the session variable
>>>>> end function
>>>>>
>>>>>
>>>>>
>>>>>
>>>>> "Aaron Bertrand - MVP" <aa***@TRASHaspfaq.com> wrote in message
>>>>> news:ue****************@TK2MSFTNGP12.phx.gbl...
>>>>>>> You would still have to store the class instance in a session
>>>>>>> variable . Your users can still whiz around your site if you
>>>>>>> just get it from the DB each page.
>>>>>>
>>>>>> And I contend that using the DB would almost surely be more
>>>>>> efficient, given correct indexing and cleanup of obsolete data...



Jul 19 '05 #16

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Fernando Rodriguez | last post by:
Hi, I need to traverse the methods defined in a class and its superclasses. This is the code I'm using: # An instance of class B should be able to check all the methods defined in B #and A,...
1
by: Oplec | last post by:
Hi, I'm learning C++ as a hobby using The C++ Programming Language : Special Edition by Bjarne Stroustrup. I'm working on chpater 13 exercises that deal with templates. Exercise 13.9 asks for me...
5
by: kuvpatel | last post by:
Hi I want to refer a class called LogEvent, and use one of its methods called WriteMessage without actually having to create an instance of Logevent. I have tried using the word sealed with...
5
by: Andy | last post by:
Hi all, I have a site with the following architecture: Common.Web.dll - Contains a CommonPageBase class which inherits System.Web.UI.Page myadd.dll - Contains PageBase which inherits...
38
by: looping | last post by:
For Python developers around. >From Python 2.5 doc: The list of base classes in a class definition can now be empty. As an example, this is now legal: class C(): pass nice but why this...
3
by: Hamilton Woods | last post by:
Diehards, I developed a template matrix class back around 1992 using Borland C++ 4.5 (ancestor of C++ Builder) and haven't touched it until a few days ago. I pulled it from the freezer and...
0
by: emin.shopper | last post by:
I had a need recently to check if my subclasses properly implemented the desired interface and wished that I could use something like an abstract base class in python. After reading up on metaclass...
2
by: Cari Elf | last post by:
I wrote a template class that inherits from the PUG xml_tree_walker class so that I can load data from any XML file without having to write a parser for each one. template <class T> class...
19
by: jan.loucka | last post by:
Hi, We're building a mapping application and inside we're using open source dll called MapServer. This dll uses object model that has quite a few classes. In our app we however need to little bit...
5
by: alan | last post by:
Hello world, I'm wondering if it's possible to implement some sort of class/object that can perform mapping from class types to strings? I will know the class type at compile time, like so:...
0
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...
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: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
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: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
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.