Skip to main content
Participating Frequently
January 4, 2007
Question

cursorType in 8.0.2

  • January 4, 2007
  • 17 replies
  • 1548 views
since the update to version 8.0.2, I am nolonger able to set the cursorType for my recordsets, which I need to do, inorder to move freely around the recordset.

How/where do I set this with the new ADODB.Command recordset method?

cheers

monkey
This topic has been closed for replies.

17 replies

boxheadAuthor
Participating Frequently
January 17, 2007
I have a situation where I want to loop through a RS to display simple info and then loop through again to display more complex info. However I am unable to reset my cursor - how would I get around this? - read into an array = more work!

monkey
Inspiring
January 11, 2007
"PGrimps" <webforumsuser@macromedia.com> wrote in message
news:eo3ta2$4k5$1@forums.macromedia.com...
>I want this functionality because I am doing nested loops using filters.
> Without making the cursor dynamic, the filter does not work properly. Do
> you
> have another solution within DW to do these nested loops (with stored
> procedures calling the data) without the dynamic cursor?

What kind of nested loop? Can you explain the situation? There is usually no
reason to nest a loop if you write your query right.

Tom Muck
http://www.tom-muck.com/


Participant
January 10, 2007
I want this functionality because I am doing nested loops using filters. Without making the cursor dynamic, the filter does not work properly. Do you have another solution within DW to do these nested loops (with stored procedures calling the data) without the dynamic cursor?
Inspiring
January 9, 2007
Lionstone wrote:
> "David Powers" <david@example.com> wrote in message
> news:enrbhn$ff5$1@forums.macromedia.com...
>> it's the unfortunate knock-on effect of closing a security loophole.
>
> Yep. But there's nothing that absolutely requires anything other than a
> server-side, read-only cursor. Some things may be simpler using a
> client-side or static cursor, but they are absolutely not required. And on
> the web at least, the things you think you need those cursors for should
> really be handled using other methods.

Thanks for the explanation. Although I don't use ASP, it's useful to
know when complaints about functionality being "taken away" are based on
an incorrect understanding of the technology. As a member of the
Community Expert program, I get the opportunity to communicate directly
with some of the development team, but I wouldn't want to bother them
with something that's not actually a problem.

> It's like having <%Option Explicit%> at the top of every page - some people
> will complain about how annoying it is to have to declare all their
> variables, but would you ever say that somebody MUST be able to use implicit
> variables? Then there's me, who'd say that if you think declaring all your
> variables is annoying, then you're probably lacking in understanding
> regarding programming in general. But I'm mean like that. ;)

I don't regard that as being mean. It's very similar to the
register_globals issue in PHP. A lot of people were upset when
register_globals was turned off in 2002 (and some still are), but it's a
basic safety measure. Dreamweaver can help with server-side programming,
but it's no substitute for a basic understanding of the technology involved.

--
David Powers, Adobe Community Expert
Author, "Foundation PHP for Dreamweaver 8" (friends of ED)
Author, "PHP Solutions" (friends of ED)
http://foundationphp.com/
Inspiring
January 9, 2007
"David Powers" <david@example.com> wrote in message
news:enrbhn$ff5$1@forums.macromedia.com...
> it's the unfortunate knock-on effect of closing a security loophole.

Yep. But there's nothing that absolutely requires anything other than a
server-side, read-only cursor. Some things may be simpler using a
client-side or static cursor, but they are absolutely not required. And on
the web at least, the things you think you need those cursors for should
really be handled using other methods.

It's like having <%Option Explicit%> at the top of every page - some people
will complain about how annoying it is to have to declare all their
variables, but would you ever say that somebody MUST be able to use implicit
variables? Then there's me, who'd say that if you think declaring all your
variables is annoying, then you're probably lacking in understanding
regarding programming in general. But I'm mean like that. ;)


Inspiring
January 7, 2007
Aleks wrote:
> This all sounds to me like 'experts' talk. To me is very simple. Its not
> about tech stuff but simple service and awareness of users needs.

I don't use ASP, so all this talk about cursors is above my head, too.

> I am no expert, but I think upgrades should update and add features, not
> take them away, specially if people use them.

The reason for the changes in 8.0.2, which applied to all server models,
was to improve security by removing loopholes in code that would expose
websites to the danger of SQL injection. I have no idea if your problem
has been caused by Adobe inadvertently removing important functionality,
or if it's the unfortunate knock-on effect of closing a security
loophole. However, the only way to get your message across to the
development team is through the feature request/bug report form:

http://www.adobe.com/cfusion/mmform/index.cfm?name=wishform

This is a user-to-user forum. So, while complaining here might get
things off your chest, it's unlikely to produce the result you want.

--
David Powers, Adobe Community Expert
Author, "Foundation PHP for Dreamweaver 8" (friends of ED)
Author, "PHP Solutions" (friends of ED)
http://foundationphp.com/
Inspiring
January 7, 2007
This all sounds to me like 'experts' talk. To me is very simple. Its not
about tech stuff but simple service and awareness of users needs.

In DWMX2004 I have the option to set the cursor type to client because
otherwise some recordsets that display longtext in the asp will not display
anything when cursor type is set to server, so I changed it, and that option
was there for a reason in the first place, I don't think Macromedia just
added it because it looked nice, it had a purpose. Now they took it off, I
take it .. for a different reason, but everyone who used that feature are
pretty much left with nothing. Now I have to switch between MX2004 and DW8,
I have to use both products.

I am no expert, but I think upgrades should update and add features, not
take them away, specially if people use them.

A



"Julian Roberts" <nospam@charon.co.uk> wrote in message
news:enmu63$fl3$1@forums.macromedia.com...
> You'll probably find that Rnd() function doesn't work in the Jet 4 engine.
> I've got an extension on my site to move to a random record.
>
> http://www.charon.co.uk/content.aspx?CategoryID=11&ArticleID=13
>
> --
> Jules
> http://www.charon.co.uk/charoncart
> Charon Cart 3
> Shopping Cart Extension for Dreamweaver MX/MX 2004
>
>
>
>
>


Inspiring
January 6, 2007
You'll probably find that Rnd() function doesn't work in the Jet 4 engine.
I've got an extension on my site to move to a random record.

http://www.charon.co.uk/content.aspx?CategoryID=11&ArticleID=13

--
Jules
http://www.charon.co.uk/charoncart
Charon Cart 3
Shopping Cart Extension for Dreamweaver MX/MX 2004





Inspiring
January 5, 2007
Try:


Set rs_cmd = Server.CreateObject ("ADODB.Command")
rs_cmd.ActiveConnection = MM_maincms_STRING
rs_cmd.CommandText = "SELECT Top 1 rec_title, rec_id
FROM mytable WHERE publish = 'Y' AND expiredate>=date() ORDER BY
Rnd(rec_id*" & (Int(1000*Rnd)+1)*-1 & ")"
rs_cmd.Prepared = true

Set rs = rs_cmd.Execute

Tom Muck
http://www.tom-muck.com/

"Rnd(product_ID*" & (Int(1000*Rnd)+1)*-1 & ")"
"boxhead" <webforumsuser@macromedia.com> wrote in message
news:enltvb$87j$1@forums.macromedia.com...
> Randomize()
> randNum = (CInt(1000 * Rnd) + 1) * -1
> response.Write(randNum)
>
> Set rs_cmd = Server.CreateObject ("ADODB.Command")
> rs_cmd.ActiveConnection = MM_maincms_STRING
> rs_cmd.CommandText = "SELECT Top 1 rec_title, rec_id, r = Rnd(" & randNum
> & ")
> FROM mytable WHERE publish = 'Y' AND expiredate>=date() ORDER BY r"
> rs_cmd.Prepared = true
>
> Set rs = rs_cmd.Execute
>
>
> errors:
>
> Microsoft OLE DB Provider for ODBC Drivers error '80040e10'
>
> [Microsoft][ODBC Microsoft Access Driver] Too few parameters. Expected 1.
>
>


boxheadAuthor
Participating Frequently
January 8, 2007
quote:

Originally posted by: Newsgroup User
Try:


Set rs_cmd = Server.CreateObject ("ADODB.Command")
rs_cmd.ActiveConnection = MM_maincms_STRING
rs_cmd.CommandText = "SELECT Top 1 rec_title, rec_id
FROM mytable WHERE publish = 'Y' AND expiredate>=date() ORDER BY
Rnd(rec_id*" & (Int(1000*Rnd)+1)*-1 & ")"
rs_cmd.Prepared = true

Set rs = rs_cmd.Execute




Top job - works perfectly. Anyone reading this need only to remember to put the randomize() function first

cheers for your help
boxheadAuthor
Participating Frequently
January 5, 2007
Randomize()
randNum = (CInt(1000 * Rnd) + 1) * -1
response.Write(randNum)

Set rs_cmd = Server.CreateObject ("ADODB.Command")
rs_cmd.ActiveConnection = MM_maincms_STRING
rs_cmd.CommandText = "SELECT Top 1 rec_title, rec_id, r = Rnd(" & randNum & ") FROM mytable WHERE publish = 'Y' AND expiredate>=date() ORDER BY r"
rs_cmd.Prepared = true

Set rs = rs_cmd.Execute


errors:

Microsoft OLE DB Provider for ODBC Drivers error '80040e10'

[Microsoft][ODBC Microsoft Access Driver] Too few parameters. Expected 1.