Solved

GetString or GetRows VBScript Class

Posted on 2003-10-29
8
1,263 Views
Last Modified: 2007-12-19
Anyone know how to do this?

My whole site is like the following when it comes to ADO and vbscript. I move through all of my stored procedure results like this

do until RS.EOF
 response.write rs(0)
 RS.movenext
Loop

What im wondering is: has anyone ever made a vbscript class to speed this up using getstring or getrows?

I.e. say your properties are:

.ConnectionString
.SQLQuery

Methods would be:

.ExecuteQuery
.MoveNext
.MovePrevious

the idea would be instead of issuing the create recordset object each time, instead instantiate a class. Feed the class the Stored procedure or Tsql query you are trying to retrieve and then using getrows or getstring, read this data into an array.

then using the move next and previous methods be able to walk the result set just like you do in ADO. Only much much faster. Same syntax, just much faster.

anyone tried this before?

Thanks!

-Matt


0
Comment
Question by:mjreine
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 3
  • 2
8 Comments
 
LVL 4

Expert Comment

by:JNSTAUB
ID: 9641384
i assume that .net do it as the recordset is created  to be transformed in a xml and serialised .after it stay in the server memory and is accessed as an array.
0
 

Author Comment

by:mjreine
ID: 9645623
JNSTAUB,

 I believe you are correct that is how a .net dataset works. Only thing is I need this to enhance the performance of my asp3 app not .net yet. Im working on learning more .net but am not there yet.

Any ideas on how to structure a class like this in vbscript (asp3)?

Thanks,

-Matt
0
 
LVL 4

Expert Comment

by:JNSTAUB
ID: 9648532
if your db is on the same server as your webserver ,i don't think that you will run faster as an optimized db engine (of course it's depend about the size of your recordset and it's complexity). if the database is on a remote server youmay create a replication of your query result in a  table in a  local DB.
however if you want to create a class you may create an two dimension object array.
a collumn per field , a row per record. you maintain a row index in your class:
movefirst method means ro_index=0
movenext                      ro_index=ro_index+1
and so on...
0
Get 15 Days FREE Full-Featured Trial

Benefit from a mission critical IT monitoring with Monitis Premium or get it FREE for your entry level monitoring needs.
-Over 200,000 users
-More than 300,000 websites monitored
-Used in 197 countries
-Recommended by 98% of users

 

Author Comment

by:mjreine
ID: 9649339
Right. Thats I think where im going is to maintain a row index in the class. Just wondering if any of the experts out here have already done this type of class before? i.e. is there code anywhere already for this on the web?

Thanks,

-Matt
0
 
LVL 4

Expert Comment

by:JNSTAUB
ID: 9650370
you may maintain your object as a session object and keep the index as a private variable in your class (of course you don't destroy the object after each page processing)
0
 
LVL 2

Accepted Solution

by:
HStruijk earned 500 total points
ID: 9672098
Look at this.

Developing a VBScript Class for an Extremely Lightweight Recordset Alternative:
http://www.asptoday.com/content.asp?id=2181

Herman
0
 
LVL 2

Expert Comment

by:HStruijk
ID: 9672107
Oh... you have to register with ASPToday to read that...

Try this link:
http://www.devarticles.com/art/1/459

Herman
0
 

Author Comment

by:mjreine
ID: 9673292
Herman... You nailed it right on the head. That was exactly the article I was looking for. Thanks!

-Matt
0

Featured Post

Is Your Team Achieving Their Full Potential?

74% of employees feel they are not achieving their full potential. With Linux Academy, not only will you strengthen your team's core competencies but also their knowledge of of the newest IT topics.

With new material every week, we'll make sure that you stay ahead of the game.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

An enjoyable and seamless user experience can go a long way on an eCommerce site. While a cohesive layout and engaging copy play roles in creating a positive user experience, some sites neglect aspects that seem marginal but in actuality prove very …
Today, the web development industry is booming, and many people consider it to be their vocation. The question you may be asking yourself is – how do I become a web developer?
This video teaches users how to migrate an existing Wordpress website to a new domain.
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.

687 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question