Re: Creating a dataset filled with random records

From: Michael D. Long (michael.d.long-nospam_at_comcast.net)
Date: 08/28/04


Date: Sat, 28 Aug 2004 02:02:41 -0400

For the love of God, have you ever tried searching the Web for anything?
Your multiple posts on this single topic cries out "I'm a hack with no
imagination that can't code, so will somebody write this for me?"

I'm not going to give you a solution in final form, but I'll tell you there
is more than one way to accomplish your goal. RAND() is the ANSI SQL
function you are looking for, but it will most likely return a series of
incrementing floating point values the way you are trying to use it because
you are passing in a series of incrementing seed values.

One possible solution to your problem is to retrieve the data and randomize
it at the client. How would one do that when she can't write code?
Hmmmm... I know! ...search Google with the following: +random +sql +".net".

Bill Vaughn politely asked you not to be a twit, but you didn't take the
advice so I'm trying the other way that is proven to motivate even a
stubborn mule. When the carrot won't work, use the stick. FYI - I haven't
poked anywhere near as much fun at you as I felt like, but I'm trying out my
new "kinder, gentler, more sympathetic" side.

p.s. - Try another Web search for +rand +ansi +sql or "sql language". Sample
results follow.
http://www.w3schools.com/sql/sql_intro.asp
http://www.cql.com/sqllang.html

-- 
Michael D. Long
"Jenny Yellman" <jaquynn@ihmail.com.donotspam> wrote in message
news:D300C0B6-3BD1-47E5-A58A-241635D723DE@microsoft.com...
> Thanks for your response - you have been most helpful.  I wonder if you
can
> tell me where I can learn more about what you call "ANSI SQL - compliant
> queries".
>
> "Steven Bras" wrote:
>
> > The problem is most likely due to the fact that the Rnd(ID) function
call is
> > not working properly under VB.Net, whereas it does when run in Access.
> > Functions such as Rnd() do not work when called from JetOLEDB or ODBC as
> > they do in Access, and the query usually needs to be written in a way to
> > accommodate this. Typically, you would evaluate Rnd(ID) in VB.Net, and
pass
> > the value of that expression explicitly to the query.
> >
> > This is because the Jet providers are not able to execute the same
> > VB-specific function calls that Access itself can. The safest bet is to
> > stick with pure ANSI SQL-compliant queries.
> >
> > Hope this helps.
> >
> >
> > "Jenny Yellman" <jaquynn@ihmail.com.donotspam> wrote in message
> > news:94C908CB-0273-4B5A-B911-3FB1E0450823@microsoft.com...
> > > I am using VB.NET and creating a dataset that is filled randomly with
> > records
> > > from a table in Access.
> > >
> > > The following statement does just what I would like when I test it in
> > > Access.  It does not do the same when I use it to configure my
dataAdapter
> > in
> > > VB.NET.
> > >
> > > SELECT Problem
> > > FROM tblX
> > > WHERE (Skill = ?)
> > > ORDER By Rnd(ID)
> > >
> > > Thanks for the help,
> > >
> > > -- 
> > > Jennifer Yellman Quynn
> > > Motivational Assessment
> >
> >
> >