Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP General > JScript & GetRows

Reply
Thread Tools

JScript & GetRows

 
 
Harag
Guest
Posts: n/a
 
      12-27-2003
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.GetRows command.

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

MyArray = clsDB.GetRecordsInArray("Stored 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.

 
Reply With Quote
 
 
 
 
Martin Honnen
Guest
Posts: n/a
 
      12-27-2003


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.GetRows 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/

 
Reply With Quote
 
 
 
 
The Mighty Chaffinch
Guest
Posts: n/a
 
      12-28-2003

"Harag" <> wrote in message
news:...
> 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.GetRows command.
>
> I have a VBscript class that handles my DB connections so in short I
> can do things like
>
> MyArray = clsDB.GetRecordsInArray("Stored 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


 
Reply With Quote
 
Chris Barber
Guest
Posts: n/a
 
      12-28-2003
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" <> wrote in message
news:bsl7uj$7u1$...

"Harag" <> wrote in message
news:...
> 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.GetRows command.
>
> I have a VBscript class that handles my DB connections so in short I
> can do things like
>
> MyArray = clsDB.GetRecordsInArray("Stored 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



 
Reply With Quote
 
The Mighty Chaffinch
Guest
Posts: n/a
 
      12-28-2003
> 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


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
What is Server-Side Jscript (not Jscript.NET)? Maxwell2006 ASP .Net 5 03-07-2006 05:28 AM
JScript.Net (JScript 7.0) is official documented language VK Javascript 4 01-12-2006 06:48 PM
Porting from JScript to JScript.Net - compiler error Jon Maz ASP .Net 4 09-09-2004 10:24 AM
Which to Learn: Javascript, Jscript, JScript.NET, ECMA 262 (3rd ed)? John Bentley Javascript 14 02-05-2004 06:14 PM
Using GetRows() Croney69 ASP General 5 07-28-2003 08:50 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57