access stored query problem
access stored query problem
am 12.09.2006 16:49:42 von Jimmy
i have a SQL query that selects a certain column from a table, then based on
the recordset.count generates a random number and does a
MoveTo(randomnumber). this works fine but i want to do it as a stored query.
my stored query is named "random". when i execute it like this:
Set oRS = oConn.Execute("random")
then try to MoveTo() i get an error "Rowset does not support fetching
backward"
is there a way to set the cursor type to adOpenStatic when opening a
recordset this way or will i have to forget about the stored query and stick
to the ORS.OPEN method?
Re: access stored query problem
am 13.09.2006 13:57:18 von Anthony Jones
"Jimmy" wrote in message
news:%23vefvqn1GHA.480@TK2MSFTNGP06.phx.gbl...
> i have a SQL query that selects a certain column from a table, then based
on
> the recordset.count generates a random number and does a
> MoveTo(randomnumber). this works fine but i want to do it as a stored
query.
>
> my stored query is named "random". when i execute it like this:
> Set oRS = oConn.Execute("random")
> then try to MoveTo() i get an error "Rowset does not support fetching
> backward"
> is there a way to set the cursor type to adOpenStatic when opening a
> recordset this way or will i have to forget about the stored query and
stick
> to the ORS.OPEN method?
>
>
Use a command object and pass it as the source parameter of the Open method
of a recordset object. Now you can pass adOpenStatic in the open method as
well.
Re: access stored query problem
am 13.09.2006 14:39:59 von Jimmy
"Anthony Jones" wrote in message
news:OwmhEvy1GHA.2196@TK2MSFTNGP06.phx.gbl...
>
> "Jimmy" wrote in message
> news:%23vefvqn1GHA.480@TK2MSFTNGP06.phx.gbl...
>> i have a SQL query that selects a certain column from a table, then based
> on
>> the recordset.count generates a random number and does a
>> MoveTo(randomnumber). this works fine but i want to do it as a stored
> query.
>>
>> my stored query is named "random". when i execute it like this:
>> Set oRS = oConn.Execute("random")
>> then try to MoveTo() i get an error "Rowset does not support fetching
>> backward"
>> is there a way to set the cursor type to adOpenStatic when opening a
>> recordset this way or will i have to forget about the stored query and
> stick
>> to the ORS.OPEN method?
>>
>>
>
>
> Use a command object and pass it as the source parameter of the Open
> method
> of a recordset object. Now you can pass adOpenStatic in the open method
> as
> well.
>
>
>
could you possibly give me a small example? i never use the command object.
thank you
Re: access stored query problem
am 14.09.2006 09:45:30 von Anthony Jones
"Jimmy" wrote in message
news:%23Q3C7Gz1GHA.4976@TK2MSFTNGP02.phx.gbl...
>
> "Anthony Jones" wrote in message
> news:OwmhEvy1GHA.2196@TK2MSFTNGP06.phx.gbl...
> >
> > "Jimmy" wrote in message
> > news:%23vefvqn1GHA.480@TK2MSFTNGP06.phx.gbl...
> >> i have a SQL query that selects a certain column from a table, then
based
> > on
> >> the recordset.count generates a random number and does a
> >> MoveTo(randomnumber). this works fine but i want to do it as a stored
> > query.
> >>
> >> my stored query is named "random". when i execute it like this:
> >> Set oRS = oConn.Execute("random")
> >> then try to MoveTo() i get an error "Rowset does not support fetching
> >> backward"
> >> is there a way to set the cursor type to adOpenStatic when opening a
> >> recordset this way or will i have to forget about the stored query and
> > stick
> >> to the ORS.OPEN method?
> >>
> >>
> >
> >
> > Use a command object and pass it as the source parameter of the Open
> > method
> > of a recordset object. Now you can pass adOpenStatic in the open method
> > as
> > well.
> >
> >
> >
>
>
> could you possibly give me a small example? i never use the command
object.
> thank you
>
>
http://support.microsoft.com/kb/168336/
see method 3 in this code. It took me 30 seconds to find via Google, is
there a reason you can't use such a search engine?
Re: access stored query problem
am 14.09.2006 14:27:42 von Jimmy
"Anthony Jones" wrote in message
news:%23RsuBH91GHA.4924@TK2MSFTNGP05.phx.gbl...
>
> "Jimmy" wrote in message
> news:%23Q3C7Gz1GHA.4976@TK2MSFTNGP02.phx.gbl...
>>
>> "Anthony Jones" wrote in message
>> news:OwmhEvy1GHA.2196@TK2MSFTNGP06.phx.gbl...
>> >
>> > "Jimmy" wrote in message
>> > news:%23vefvqn1GHA.480@TK2MSFTNGP06.phx.gbl...
>> >> i have a SQL query that selects a certain column from a table, then
> based
>> > on
>> >> the recordset.count generates a random number and does a
>> >> MoveTo(randomnumber). this works fine but i want to do it as a stored
>> > query.
>> >>
>> >> my stored query is named "random". when i execute it like this:
>> >> Set oRS = oConn.Execute("random")
>> >> then try to MoveTo() i get an error "Rowset does not support fetching
>> >> backward"
>> >> is there a way to set the cursor type to adOpenStatic when opening a
>> >> recordset this way or will i have to forget about the stored query and
>> > stick
>> >> to the ORS.OPEN method?
>> >>
>> >>
>> >
>> >
>> > Use a command object and pass it as the source parameter of the Open
>> > method
>> > of a recordset object. Now you can pass adOpenStatic in the open
>> > method
>> > as
>> > well.
>> >
>> >
>> >
>>
>>
>> could you possibly give me a small example? i never use the command
> object.
>> thank you
>>
>>
>
> http://support.microsoft.com/kb/168336/
>
> see method 3 in this code. It took me 30 seconds to find via Google, is
> there a reason you can't use such a search engine?
>
>
thanks. what order do the arguments have to be passed?
for example, this fails:
oRS.Open oCMD, adOpenStatic
you said adOpenStatic could be passed but you never mentioned what position
it had to be in in the arg list.
thank you
Re: access stored query problem
am 14.09.2006 14:54:53 von Anthony Jones
"Jimmy" wrote in message
news:ebxRuk$1GHA.4476@TK2MSFTNGP02.phx.gbl...
>
> "Anthony Jones" wrote in message
> news:%23RsuBH91GHA.4924@TK2MSFTNGP05.phx.gbl...
> >
> > "Jimmy" wrote in message
> > news:%23Q3C7Gz1GHA.4976@TK2MSFTNGP02.phx.gbl...
> >>
> >> "Anthony Jones" wrote in message
> >> news:OwmhEvy1GHA.2196@TK2MSFTNGP06.phx.gbl...
> >> >
> >> > "Jimmy" wrote in message
> >> > news:%23vefvqn1GHA.480@TK2MSFTNGP06.phx.gbl...
> >> >> i have a SQL query that selects a certain column from a table, then
> > based
> >> > on
> >> >> the recordset.count generates a random number and does a
> >> >> MoveTo(randomnumber). this works fine but i want to do it as a
stored
> >> > query.
> >> >>
> >> >> my stored query is named "random". when i execute it like this:
> >> >> Set oRS = oConn.Execute("random")
> >> >> then try to MoveTo() i get an error "Rowset does not support
fetching
> >> >> backward"
> >> >> is there a way to set the cursor type to adOpenStatic when opening
a
> >> >> recordset this way or will i have to forget about the stored query
and
> >> > stick
> >> >> to the ORS.OPEN method?
> >> >>
> >> >>
> >> >
> >> >
> >> > Use a command object and pass it as the source parameter of the Open
> >> > method
> >> > of a recordset object. Now you can pass adOpenStatic in the open
> >> > method
> >> > as
> >> > well.
> >> >
> >> >
> >> >
> >>
> >>
> >> could you possibly give me a small example? i never use the command
> > object.
> >> thank you
> >>
> >>
> >
> > http://support.microsoft.com/kb/168336/
> >
> > see method 3 in this code. It took me 30 seconds to find via Google, is
> > there a reason you can't use such a search engine?
> >
> >
>
> thanks. what order do the arguments have to be passed?
> for example, this fails:
>
> oRS.Open oCMD, adOpenStatic
>
> you said adOpenStatic could be passed but you never mentioned what
position
> it had to be in in the arg list.
>
For crying out loud!! RTM
How hard can it be for you find the documentation for ADO??
> thank you
>
>
Re: access stored query problem
am 14.09.2006 15:02:34 von Jimmy
"Anthony Jones" wrote in message
news:efpH6z$1GHA.1288@TK2MSFTNGP03.phx.gbl...
>
> "Jimmy" wrote in message
> news:ebxRuk$1GHA.4476@TK2MSFTNGP02.phx.gbl...
>>
>> "Anthony Jones" wrote in message
>> news:%23RsuBH91GHA.4924@TK2MSFTNGP05.phx.gbl...
>> >
>> > "Jimmy" wrote in message
>> > news:%23Q3C7Gz1GHA.4976@TK2MSFTNGP02.phx.gbl...
>> >>
>> >> "Anthony Jones" wrote in message
>> >> news:OwmhEvy1GHA.2196@TK2MSFTNGP06.phx.gbl...
>> >> >
>> >> > "Jimmy" wrote in message
>> >> > news:%23vefvqn1GHA.480@TK2MSFTNGP06.phx.gbl...
>> >> >> i have a SQL query that selects a certain column from a table, then
>> > based
>> >> > on
>> >> >> the recordset.count generates a random number and does a
>> >> >> MoveTo(randomnumber). this works fine but i want to do it as a
> stored
>> >> > query.
>> >> >>
>> >> >> my stored query is named "random". when i execute it like this:
>> >> >> Set oRS = oConn.Execute("random")
>> >> >> then try to MoveTo() i get an error "Rowset does not support
> fetching
>> >> >> backward"
>> >> >> is there a way to set the cursor type to adOpenStatic when opening
> a
>> >> >> recordset this way or will i have to forget about the stored query
> and
>> >> > stick
>> >> >> to the ORS.OPEN method?
>> >> >>
>> >> >>
>> >> >
>> >> >
>> >> > Use a command object and pass it as the source parameter of the Open
>> >> > method
>> >> > of a recordset object. Now you can pass adOpenStatic in the open
>> >> > method
>> >> > as
>> >> > well.
>> >> >
>> >> >
>> >> >
>> >>
>> >>
>> >> could you possibly give me a small example? i never use the command
>> > object.
>> >> thank you
>> >>
>> >>
>> >
>> > http://support.microsoft.com/kb/168336/
>> >
>> > see method 3 in this code. It took me 30 seconds to find via Google,
>> > is
>> > there a reason you can't use such a search engine?
>> >
>> >
>>
>> thanks. what order do the arguments have to be passed?
>> for example, this fails:
>>
>> oRS.Open oCMD, adOpenStatic
>>
>> you said adOpenStatic could be passed but you never mentioned what
> position
>> it had to be in in the arg list.
>>
>
> For crying out loud!! RTM
>
> How hard can it be for you find the documentation for ADO??
>
>> thank you
>>
>>
>
>
if everyone read all the manuals, and spent the time required to google for
everything, there would hardly be a need for newsgroups, wouldnt you agree?
for the most part people come here when they need a quick, accurate answer
(which you havent been able to provide, but you create the illusion that you
know what youre talking about by saying "RTM")
so come on tough guy... no googling, tell me ALL the args the command object
can be passed and in what order they need to be passed?
thats what i thought.
Re: access stored query problem
am 14.09.2006 15:57:34 von Anthony Jones
"Jimmy" wrote in message
news:%23mOFN4$1GHA.4752@TK2MSFTNGP05.phx.gbl...
>
> "Anthony Jones" wrote in message
> news:efpH6z$1GHA.1288@TK2MSFTNGP03.phx.gbl...
> >
> > "Jimmy" wrote in message
> > news:ebxRuk$1GHA.4476@TK2MSFTNGP02.phx.gbl...
> >>
> >> "Anthony Jones" wrote in message
> >> news:%23RsuBH91GHA.4924@TK2MSFTNGP05.phx.gbl...
> >> >
> >> > "Jimmy" wrote in message
> >> > news:%23Q3C7Gz1GHA.4976@TK2MSFTNGP02.phx.gbl...
> >> >>
> >> >> "Anthony Jones" wrote in message
> >> >> news:OwmhEvy1GHA.2196@TK2MSFTNGP06.phx.gbl...
> >> >> >
> >> >> > "Jimmy" wrote in message
> >> >> > news:%23vefvqn1GHA.480@TK2MSFTNGP06.phx.gbl...
> >> >> >> i have a SQL query that selects a certain column from a table,
then
> >> > based
> >> >> > on
> >> >> >> the recordset.count generates a random number and does a
> >> >> >> MoveTo(randomnumber). this works fine but i want to do it as a
> > stored
> >> >> > query.
> >> >> >>
> >> >> >> my stored query is named "random". when i execute it like this:
> >> >> >> Set oRS = oConn.Execute("random")
> >> >> >> then try to MoveTo() i get an error "Rowset does not support
> > fetching
> >> >> >> backward"
> >> >> >> is there a way to set the cursor type to adOpenStatic when
opening
> > a
> >> >> >> recordset this way or will i have to forget about the stored
query
> > and
> >> >> > stick
> >> >> >> to the ORS.OPEN method?
> >> >> >>
> >> >> >>
> >> >> >
> >> >> >
> >> >> > Use a command object and pass it as the source parameter of the
Open
> >> >> > method
> >> >> > of a recordset object. Now you can pass adOpenStatic in the open
> >> >> > method
> >> >> > as
> >> >> > well.
> >> >> >
> >> >> >
> >> >> >
> >> >>
> >> >>
> >> >> could you possibly give me a small example? i never use the command
> >> > object.
> >> >> thank you
> >> >>
> >> >>
> >> >
> >> > http://support.microsoft.com/kb/168336/
> >> >
> >> > see method 3 in this code. It took me 30 seconds to find via Google,
> >> > is
> >> > there a reason you can't use such a search engine?
> >> >
> >> >
> >>
> >> thanks. what order do the arguments have to be passed?
> >> for example, this fails:
> >>
> >> oRS.Open oCMD, adOpenStatic
> >>
> >> you said adOpenStatic could be passed but you never mentioned what
> > position
> >> it had to be in in the arg list.
> >>
> >
> > For crying out loud!! RTM
> >
> > How hard can it be for you find the documentation for ADO??
> >
> >> thank you
> >>
> >>
> >
> >
>
> if everyone read all the manuals, and spent the time required to google
for
> everything, there would hardly be a need for newsgroups, wouldnt you
agree?
> for the most part people come here when they need a quick, accurate answer
> (which you havent been able to provide, but you create the illusion that
you
> know what youre talking about by saying "RTM")
>
> so come on tough guy... no googling, tell me ALL the args the command
object
> can be passed and in what order they need to be passed?
>
> thats what i thought.
>
>
By now I don't think anyone else cares what you think I certainly don't.
Goodbye.
Re: access stored query problem
am 14.09.2006 16:15:49 von Daniel Crichton
Jimmy wrote on Thu, 14 Sep 2006 09:02:34 -0400:
> if everyone read all the manuals, and spent the time required to google
> for everything, there would hardly be a need for newsgroups, wouldnt you
> agree? for the most part people come here when they need a quick, accurate
> answer (which you havent been able to provide, but you create the illusion
> that you know what youre talking about by saying "RTM")
Reading the documentation should be the first step in finding a solution.
How do you expect to learn anything if you don't even understand what you
are trying to do?
Dan