Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

cursorType in 8.0.2

New Here ,
Jan 04, 2007 Jan 04, 2007
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
TOPICS
Server side applications
1.5K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jan 04, 2007 Jan 04, 2007
Basicly, you can't. The new recordsets use the firehose (forward only)
cursor and can't be changed.

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





Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jan 04, 2007 Jan 04, 2007
can anyone from Adobe/macromedia explain why they have made it impossible to change. I understand why they have made the change, but surly some sort of vercitility is required?
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jan 04, 2007 Jan 04, 2007
Yeah, I haven't upgraded to .0.2 for this very reason. Backward
compatibility could have been preserved, but they chose not to do it.
Anyway, I've outlined a possible manual solution here:

http://groups.google.co.uk/group/macromedia.dreamweaver.appdev/browse_thread/thread/4dc2391d32f0e161...

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





Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jan 04, 2007 Jan 04, 2007
I'll be perfectly blunt with you: if you need anything other than a firehose
cursor in an ASP web site, then you're doing something wrong. Period. The
other ADO cursor types have utility for desktop applications, but really
should not be used on the web. Most of the issues people use cursor types
to fix have other solutions. If you think you need to move back and forth
in a recordset, you're probably wrong. If you really do, then you should be
using GetRows() and the resulting 2-D array.


"boxhead" <webforumsuser@macromedia.com> wrote in message
news:eniorg$c1v$1@forums.macromedia.com...
> can anyone from Adobe/macromedia explain why they have made it impossible
> to change. I understand why they have made the change, but surly some
> sort of vercitility is required?


Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jan 04, 2007 Jan 04, 2007
quote:

Originally posted by: Newsgroup User
I'll be perfectly blunt with you: if you need anything other than a firehose
cursor in an ASP web site, then you're doing something wrong.




In fairness, i'm not doing it wrong, just being lazy! I use a different cursortype in 2 situation - one to choose a random record (rs.move (randno)) which I should use an array for, and when using a memo data from a db more than once (a variable solves this problem.)

Incidentally, why can I not use memo data more than once on a page?

cheers

monkey
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jan 04, 2007 Jan 04, 2007
"boxhead" <webforumsuser@macromedia.com> wrote in message
news:enjc4u$54v$1@forums.macromedia.com...
> In fairness, i'm not doing it wrong, just being lazy! I use a different
> cursortype in 2 situation - one to choose a random record (rs.move
> (randno))
> which I should use an array for, and when using a memo data from a db more
> than
> once (a variable solves this problem.)
>

This is the kind of stuff I'm talking about. Returning a whole host of
records to display one random record is wrong. Why? It wastes a lot of
bandwidth. Select only the record you want to see. How depends on what
your key is. If you've just used an integer key, you can use Access' Rnd
function:

myRS.Source = "SELECT TOP 1 stuff FROM myTable ORDER BY Rnd(RecordID)"

> Incidentally, why can I not use memo data more than once on a page?
>

That's just a limitation of the JET driver. BLOB columns are often harder
to work with because they can be up to 2GB and the provider has to make
allowances for that. I don't know for Access, but for SQL Server (which has
a different brand of BLOB-related quirks in its ADO providers), simply
listing your TEXT (similar to Access' MEMO) columns last in the select list
will fix the problem. If it works for Access, great; if not, then, as you
said, just use a local variable.


Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jan 04, 2007 Jan 04, 2007
Indeed, experienced developers will stream in records using getRows and
encapsulate functionality in classes. But that doesn't mean everyone has to
do. Dreamweaver recordsets have been adequate for many developers for years.
And it is certainly not wrong to use them. It's about judgement and opinion,
not stone cold fact.

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




Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jan 04, 2007 Jan 04, 2007
LionStone "perfectly blunt"? ;)
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jan 04, 2007 Jan 04, 2007
I know! It happens so rarely. ;)

"Lee" <lee_nospam_@artjunky.com> wrote in message
news:enjjse$dt1$1@forums.macromedia.com...
> LionStone "perfectly blunt"? 😉


Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jan 04, 2007 Jan 04, 2007
I think this should be fixed, many of my recordsets won't work in DW8 and I
have to go back to MX2004 ... isn't DW8 an upgrade ? On this feels much more
like a downgrade.

A


"Julian Roberts" <nospam@charon.co.uk> wrote in message
news:enins8$au6$1@forums.macromedia.com...
> Basicly, you can't. The new recordsets use the firehose (forward only)
> cursor and can't be changed.
>
> --
> Jules
> http://www.charon.co.uk/charoncart
> Charon Cart 3
> Shopping Cart Extension for Dreamweaver MX/MX 2004
>
>
>
>
>


Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jan 04, 2007 Jan 04, 2007
so basically revert back to the old way of doing this! Are Macromedia aware of this issue?
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jan 04, 2007 Jan 04, 2007
boxhead wrote:
> so basically revert back to the old way of doing this! Are Macromedia aware of this issue?

It's not Macromedia any more, but I've drawn the attention of the Adobe
team to this thread. You can also get in touch with them directly by
filing a feature request/bug report here:

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

--
David Powers, Adobe Community Expert
Author, "Foundation PHP for Dreamweaver 8" (friends of ED)
Author, "PHP Solutions" (friends of ED)
http://foundationphp.com/
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jan 05, 2007 Jan 05, 2007
LionStone

I tryed the Accces Rnd function, but it appeared to bring back the same record every time. I have read this is due to the record ID (a auto sequential number) being the same everytime.

How do i get around this?

P.S. in my defence, there are only about 8 records pulled back and I didn't have the knowledge at the time to do it properly. :)
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jan 05, 2007 Jan 05, 2007
You have to pass something in to Rnd which is variable in order for it to
calculate a new value each time. If the value is cached, then it would do
no good. :)

This might do it:

<%
Randomize()
randNum = (CInt(1000 * Rnd) + 1) * -1

...snip...

myRS.Source = "SELECT TOP 1 <column list>, r = Rnd(" & randNum & ") FROM
TableName ORDER BY r"
....snip....
%>

If that doesn't get a random record, then change r = Rnd(" & randNum & ") to
r = Rnd(" & randNum & "*RecordID)



"boxhead" <webforumsuser@macromedia.com> wrote in message
news:enl5qe$9j1$1@forums.macromedia.com...
> LionStone
>
> I tryed the Accces Rnd function, but it appeared to bring back the same
> record
> every time. I have read this is due to the record ID (a auto sequential
> number) being the same everytime.
>
> How do i get around this?
>
> P.S. in my defence, there are only about 8 records pulled back and I
> didn't
> have the knowledge at the time to do it properly. :)
>


Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jan 05, 2007 Jan 05, 2007

"Lionstone" <HIDElionstone@HIDEhushmail.com> wrote in message
news:enln0r$t2h$1@forums.macromedia.com...
> You have to pass something in to Rnd which is variable in order for it to
> calculate a new value each time. If the value is cached, then it would do
> no good. :)

I thought RecordID would be sufficient for seeding Rnd, but it obviously
wasn't. Just reiterating b/c it sounds like I'm blaming you there. I was
just thinking out loud, mostly.

Anyway, the stuff in the last post should work.


Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jan 05, 2007 Jan 05, 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.
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jan 05, 2007 Jan 05, 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.
>
>


Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jan 08, 2007 Jan 08, 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
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jan 08, 2007 Jan 08, 2007
> Top job - works perfectly. Anyone reading this need only to remember to
> put
> the randomize() function first
>
> cheers for your help

No problem. Glad it helped. Unfortunately the problem lies with Access being
not suited for these types of queries and having to find workarounds.

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


Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jan 05, 2007 Jan 05, 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





Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jan 07, 2007 Jan 07, 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
>
>
>
>
>


Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jan 07, 2007 Jan 07, 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/
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jan 09, 2007 Jan 09, 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. 😉


Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jan 09, 2007 Jan 09, 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/
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines