473,573 Members | 2,836 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

JScript & GetRows

Hi All

I currently thinking of converting from my little knowledge of
VBscript to jScript ASP.

With this in mind I'm looking at my current code to see how it will
convert over to Jscript.

One thing I have spotted that I can't think of a way round is the ADO
recordset.GetRo ws command.

I have a VBscript class that handles my DB connections so in short I
can do things like

MyArray = clsDB.GetRecord sInArray("Store d Proc Name/SQL", other
params)

and this would return the rows into a 2 dimension array.

Problem is I've read that Jscript only has one dimension. So how is
the "getRows" solved for Jscript.
Also is there any good "Jscript" code learning sites?

Thanks for any help
Al.

Jul 19 '05 #1
4 5853


Harag wrote:
I currently thinking of converting from my little knowledge of
VBscript to jScript ASP.

With this in mind I'm looking at my current code to see how it will
convert over to Jscript.

One thing I have spotted that I can't think of a way round is the ADO
recordset.GetRo ws command.


I think you can well use ADO without ever using getRows. If you want to
use it with JScript you need to do some conversion on the safe array
returned, here is an example
http://groups.google.com/groups?q=ge...phx.gbl&rnum=1

--

Martin Honnen
http://JavaScript.FAQTs.com/

Jul 19 '05 #2

"Harag" <ha***@REMOVETH ESECAPITALSsoft home.net> wrote in message
news:b8******** *************** *********@4ax.c om...
Hi All

I currently thinking of converting from my little knowledge of
VBscript to jScript ASP.

With this in mind I'm looking at my current code to see how it will
convert over to Jscript.

One thing I have spotted that I can't think of a way round is the ADO
recordset.GetRo ws command.

I have a VBscript class that handles my DB connections so in short I
can do things like

MyArray = clsDB.GetRecord sInArray("Store d Proc Name/SQL", other
params)

and this would return the rows into a 2 dimension array.

Problem is I've read that Jscript only has one dimension. So how is
the "getRows" solved for Jscript.
Also is there any good "Jscript" code learning sites?

Thanks for any help
Al.


The JScript VBArray type allows you to handle the results of recset.GetRows.

Other problem areas may be regional formats: date/time/numbers etc which are
not handled in JScript. No reference parameters eg record_count returned
from ADO. Most ASP material (95% +) on the WWW is VBScript-based.

MightyC

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.547 / Virus Database: 340 - Release Date: 03/12/03
Jul 19 '05 #3
Funnily enough I've just gone through this and converted what was a class
based system for ADO (disconnected recordsets and stored procedure calling)
to JScript and had to write my own handler for dates to construct and
deconstruct ISO format. These two together have made life a lot simpler for
me since I can use the date formatting .js file in both client side and
server-side code with no changes.

I must admit to having never used GetRows since I do all my HTML output
using XSLT not looping through arrays.

Still, VBScript does seem to trump JScript for dates and formatting but once
you find a nice library for it then there is no difference.

I used to be a staunch supporter of VBScript for ASP but in recent weeks
I've come to realise that there is no real cons to using JScript for both
whilst the benefit of maintaining a single code library has halved the
effort that I need to put in to generating this stuff. That's not to say
that VBScript doesn't have it's place - it does - although if I ever find an
IDE for ASP that allows intellisense for JScript objects (eg. .prototype
stuff) then I'll happily drop VBScript for evermore.

In part I have to thank Alex for this complete turn around in coding - it
was a long-ish thread where the pros and cons of VBScript vs. JScript were
discussed that set me off trying to have a go - it was surprisingly easy.

Cheers,

Chris.

"The Mighty Chaffinch" <mi************ *@hotmail.com> wrote in message
news:bs******** **@sparta.btint ernet.com...

"Harag" <ha***@REMOVETH ESECAPITALSsoft home.net> wrote in message
news:b8******** *************** *********@4ax.c om...
Hi All

I currently thinking of converting from my little knowledge of
VBscript to jScript ASP.

With this in mind I'm looking at my current code to see how it will
convert over to Jscript.

One thing I have spotted that I can't think of a way round is the ADO
recordset.GetRo ws command.

I have a VBscript class that handles my DB connections so in short I
can do things like

MyArray = clsDB.GetRecord sInArray("Store d Proc Name/SQL", other
params)

and this would return the rows into a 2 dimension array.

Problem is I've read that Jscript only has one dimension. So how is
the "getRows" solved for Jscript.
Also is there any good "Jscript" code learning sites?

Thanks for any help
Al.


The JScript VBArray type allows you to handle the results of recset.GetRows.

Other problem areas may be regional formats: date/time/numbers etc which are
not handled in JScript. No reference parameters eg record_count returned
from ADO. Most ASP material (95% +) on the WWW is VBScript-based.

MightyC

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.547 / Virus Database: 340 - Release Date: 03/12/03

Jul 19 '05 #4
> Funnily enough I've just gone through this and converted what was a class
based system for ADO (disconnected recordsets and stored procedure calling) to JScript and had to write my own handler for dates to construct and
deconstruct ISO format. These two together have made life a lot simpler for me since I can use the date formatting .js file in both client side and
server-side code with no changes.
I use all JScript server-side except for a few bits & pieces. I'm from a
C/block structure programming background so to me it was a natural choice.
Folks coming from Visual Basic I guess would prefer VBScript for similar
reasons. In truth I think both languages can do the job as well as each
other, it's a matter of personal preference.

But I've noticed a bias against server-side JScript in this group at times,
often the reasons given are far from convincing, eg. "So you can tell which
is client-side code and which is server-side code." So I speak up when I see
the subject is raised to provide a more measured viewpoint (I hope!)
I must admit to having never used GetRows since I do all my HTML output
using XSLT not looping through arrays.
I use it a lot. It's not the JScript showstopper that some would have you
believe. I can post some code if anyone is interested.
Still, VBScript does seem to trump JScript for dates and formatting but once you find a nice library for it then there is no difference.
There is currently no support for regional formats in JScript: MS sat they
are waiting for an ECMA standard before they do it. This is an area where
you might have to drop into a little VBScript or develop your own solution.
I used to be a staunch supporter of VBScript for ASP but in recent weeks
I've come to realise that there is no real cons to using JScript for both
whilst the benefit of maintaining a single code library has halved the
effort that I need to put in to generating this stuff. That's not to say
that VBScript doesn't have it's place - it does - although if I ever find an IDE for ASP that allows intellisense for JScript objects (eg. .prototype
stuff) then I'll happily drop VBScript for evermore.


Nice to hear of a convert!

MightyC
Jul 19 '05 #5

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

Similar topics

3
3228
by: Andie | last post by:
Hello All, How would I go about using a disconnect recordset and select (x) records from it, x being the number of records to be selected. Many thanks in advance. -- Andie
5
8169
by: Croney69 | last post by:
I am getting information out of a table to place into to an Array. rs=DataConn.Execute(strSQL) At this point I place it into the array objArray=rs.GetRows() But how do I handle things if the rs came back blank?
11
3505
by: Laphan | last post by:
Hi All I'm using .getRows() with a local var array instead of doing a recursive loop so that I'm being a good ASP newvbie and closing my object i/o's (the recordset in this case) as quick as possible. My problem is that I can't seem to use this to complete good effect because the IsArray statement doesn't seem to work with a local var...
1
2079
by: SABmore | last post by:
I have the following code that populates 3 independent drop-down boxes with data from arrays. From there the user can select a value from a drop-down list, or input data into a text box. The user then submits this to be inserted into the database. Currently I've only programmed to have the first input box/drop-down valid. The problem I am...
9
3653
by: bajopalabra | last post by:
hi session("myVar") = rs.getRows( ) don't work when number of records is greater than 10 does anybody know WHY ??? is it a Session object limitation ??? thanks
10
26294
by: Hank | last post by:
Hello, I'm having trouble reading from a table directly into an array using Access 2000. Dim db As Database Dim rsTime As Recordset Dim TimeArray As Variant Set db = CurrentDb Set rsTime = db.OpenRecordset("Time Record")
1
3441
by: Andrew Wan | last post by:
How can VBScript code access JScript code variables in the same ASP page? <SCRIPT LANGAUGE="VBScript"> Dim a a = 10 </SCRIPT> <SCRIPT LANGUAGE="JScript"> Response.Write(a); </SCRIPT>
9
35395
ADezii
by: ADezii | last post by:
One question which pops up frequently here at TheScripts is: 'How do I retrieve data from a Recordset once I've created it?' One very efficient, and not that often used approach, is the GetRows() Method of the Recordset Object. This Method varies slightly from DAO to ADO, so for purposes of this discussion, we'll be talking about DAO Recordsets....
3
43445
ADezii
by: ADezii | last post by:
Last Tip, we demonstrated the technique for retrieving data from a DAO Recordset, and placing it into a 2-dimensional Array using the GetRows() Method. This week, we will cover the same exact Method (GetRows()), but only as it applies to an ADO Recordset. Although there are similarities in the 2 methodologies, the ADO Method offers 2 more Optional...
0
7679
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7996
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
8191
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
0
8049
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
5284
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3724
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3723
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1289
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
1029
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.