How to use SQL "LIMIT" keyword against an MDB file

How to use SQL "LIMIT" keyword against an MDB file

am 28.01.2008 22:37:03 von martin

I'm trying to adapt a PHP script that was written to use MySQL, so
that it will work with an MSAccess MDB file.

An important part of the script makes use of the SQL "LIMIT" keyword
available in MySQL. eg: "SELECT MyField FROM MyTable LIMIT 40,10" to
select 10 records beginning at the 41st record.

Can anyone tell me how I can achieve this same functionality when
using ODBC functions to access an MDB file? I think I can set ROWCOUNT
(or possibly TOP) to retrieve only 10 records but how do I get it to
start at the 41st record?

Re: How to use SQL "LIMIT" keyword against an MDB file

am 28.01.2008 22:50:48 von Ivan Marsh

On Mon, 28 Jan 2008 14:37:03 -0700, Martin wrote:

> I'm trying to adapt a PHP script that was written to use MySQL, so that
> it will work with an MSAccess MDB file.
>
> An important part of the script makes use of the SQL "LIMIT" keyword
> available in MySQL. eg: "SELECT MyField FROM MyTable LIMIT 40,10" to
> select 10 records beginning at the 41st record.
>
> Can anyone tell me how I can achieve this same functionality when using
> ODBC functions to access an MDB file? I think I can set ROWCOUNT (or
> possibly TOP) to retrieve only 10 records but how do I get it to start
> at the 41st record?

You just lost an enormous amount of functionality. I'm assuming this is
something you had to do.

Pull all of the records and then programatically strip out the records you
don't want from the array.

--
I told you this was going to happen.

Re: How to use SQL "LIMIT" keyword against an MDB file

am 28.01.2008 23:09:32 von Steve

"Ivan Marsh" wrote in message
news:pan.2008.01.28.21.50.48.197643@you.now...
> On Mon, 28 Jan 2008 14:37:03 -0700, Martin wrote:
>
>> I'm trying to adapt a PHP script that was written to use MySQL, so that
>> it will work with an MSAccess MDB file.
>>
>> An important part of the script makes use of the SQL "LIMIT" keyword
>> available in MySQL. eg: "SELECT MyField FROM MyTable LIMIT 40,10" to
>> select 10 records beginning at the 41st record.
>>
>> Can anyone tell me how I can achieve this same functionality when using
>> ODBC functions to access an MDB file? I think I can set ROWCOUNT (or
>> possibly TOP) to retrieve only 10 records but how do I get it to start
>> at the 41st record?
>
> You just lost an enormous amount of functionality. I'm assuming this is
> something you had to do.
>
> Pull all of the records and then programatically strip out the records you
> don't want from the array.

are you out of your fucking mind?!!!

yeah, let me pull all the records from my 55 million rowed table into a php
array...THEN strip out the unwanted ones from the array. hell, let's just
put the records into a text file and pull them from there...build our own
php query functionality for the file. while we're at it, we'll run our lil
'query' in a loop. and, for good measure...

you've got to be fucking kidding...right?!!!

Re: How to use SQL "LIMIT" keyword against an MDB file

am 28.01.2008 23:40:55 von Ivan Marsh

On Mon, 28 Jan 2008 16:09:32 -0600, Steve wrote:


> "Ivan Marsh" wrote in message
> news:pan.2008.01.28.21.50.48.197643@you.now...
>> On Mon, 28 Jan 2008 14:37:03 -0700, Martin wrote:
>>
>>> I'm trying to adapt a PHP script that was written to use MySQL, so
>>> that it will work with an MSAccess MDB file.
>>>
>>> An important part of the script makes use of the SQL "LIMIT" keyword
>>> available in MySQL. eg: "SELECT MyField FROM MyTable LIMIT 40,10" to
>>> select 10 records beginning at the 41st record.
>>>
>>> Can anyone tell me how I can achieve this same functionality when
>>> using ODBC functions to access an MDB file? I think I can set ROWCOUNT
>>> (or possibly TOP) to retrieve only 10 records but how do I get it to
>>> start at the 41st record?
>>
>> You just lost an enormous amount of functionality. I'm assuming this is
>> something you had to do.
>>
>> Pull all of the records and then programatically strip out the records
>> you don't want from the array.
>
> are you out of your fucking mind?!!!

I assure you I'm not... though I don't claim to be Mr. Grand Wizard PHP
Programmer Guy.

> yeah, let me pull all the records from my 55 million rowed table into a
> php array...

Can you fit 55 million rows in an Access database that's less than 2 gigs?

> THEN strip out the unwanted ones from the array. hell, let's just put
> the records into a text file and pull them from there...build our own
> php query functionality for the file. while we're at it, we'll run our
> lil 'query' in a loop. and, for good measure...

You may very well have to do that. Like I said: You/He just lost an
enormous amount of functionality.

> you've got to be fucking kidding...right?!!!

No... An Access MDB file would simply be the wrong tool for the job unless
you're dealing with a very small dataset.

Without a LIMIT function you have to query for the matching records with
odbc_exec and then eliminate the unwanted data from the result set or move
the wanted data to a new array. I don't know of any way of doing it at
query time... and while I was looking into it when I had to use a dBase
file as a backend for a project it was apparent that no one else did
either.

If you have a run-time solution please share it with the group. I could
sure use it.

--
I told you this was going to happen.

Re: How to use SQL "LIMIT" keyword against an MDB file

am 28.01.2008 23:44:06 von Jerry Stuckle

Steve wrote:
> "Ivan Marsh" wrote in message
> news:pan.2008.01.28.21.50.48.197643@you.now...
>> On Mon, 28 Jan 2008 14:37:03 -0700, Martin wrote:
>>
>>> I'm trying to adapt a PHP script that was written to use MySQL, so that
>>> it will work with an MSAccess MDB file.
>>>
>>> An important part of the script makes use of the SQL "LIMIT" keyword
>>> available in MySQL. eg: "SELECT MyField FROM MyTable LIMIT 40,10" to
>>> select 10 records beginning at the 41st record.
>>>
>>> Can anyone tell me how I can achieve this same functionality when using
>>> ODBC functions to access an MDB file? I think I can set ROWCOUNT (or
>>> possibly TOP) to retrieve only 10 records but how do I get it to start
>>> at the 41st record?
>> You just lost an enormous amount of functionality. I'm assuming this is
>> something you had to do.
>>
>> Pull all of the records and then programatically strip out the records you
>> don't want from the array.
>
> are you out of your fucking mind?!!!
>
> yeah, let me pull all the records from my 55 million rowed table into a php
> array...THEN strip out the unwanted ones from the array. hell, let's just
> put the records into a text file and pull them from there...build our own
> php query functionality for the file. while we're at it, we'll run our lil
> 'query' in a loop. and, for good measure...
>
> you've got to be fucking kidding...right?!!!
>
>
>

No, he's not. Access doesn't have the same capabilities of MySQL. You
have to work around its limitations.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================

Re: How to use SQL "LIMIT" keyword against an MDB file

am 28.01.2008 23:49:15 von martin

On Mon, 28 Jan 2008 14:37:03 -0700, Martin
wrote:

>I'm trying to adapt a PHP script that was written to use MySQL, so
>that it will work with an MSAccess MDB file.
>
>An important part of the script makes use of the SQL "LIMIT" keyword
>available in MySQL. eg: "SELECT MyField FROM MyTable LIMIT 40,10" to
>select 10 records beginning at the 41st record.
>
>Can anyone tell me how I can achieve this same functionality when
>using ODBC functions to access an MDB file? I think I can set ROWCOUNT
>(or possibly TOP) to retrieve only 10 records but how do I get it to
>start at the 41st record?

OK - never mind. Thanks anyway.

I finally figured out the right words to google for and found what I
was looking for.

Re: How to use SQL "LIMIT" keyword against an MDB file

am 28.01.2008 23:53:35 von Ivan Marsh

On Mon, 28 Jan 2008 15:49:15 -0700, Martin wrote:

> On Mon, 28 Jan 2008 14:37:03 -0700, Martin
> wrote:
>
>>I'm trying to adapt a PHP script that was written to use MySQL, so
>>that it will work with an MSAccess MDB file.
>>
>>An important part of the script makes use of the SQL "LIMIT" keyword
>>available in MySQL. eg: "SELECT MyField FROM MyTable LIMIT 40,10" to
>>select 10 records beginning at the 41st record.
>>
>>Can anyone tell me how I can achieve this same functionality when
>>using ODBC functions to access an MDB file? I think I can set ROWCOUNT
>>(or possibly TOP) to retrieve only 10 records but how do I get it to
>>start at the 41st record?
>
> OK - never mind. Thanks anyway.
>
> I finally figured out the right words to google for and found what I
> was looking for.

Care to share?

--
I told you this was going to happen.

Re: How to use SQL "LIMIT" keyword against an MDB file

am 29.01.2008 00:08:29 von Steve

"Ivan Marsh" wrote in message
news:pan.2008.01.28.22.40.54.715306@you.now...
> On Mon, 28 Jan 2008 16:09:32 -0600, Steve wrote:
>
>
>> "Ivan Marsh" wrote in message
>> news:pan.2008.01.28.21.50.48.197643@you.now...
>>> On Mon, 28 Jan 2008 14:37:03 -0700, Martin wrote:
>>>
>>>> I'm trying to adapt a PHP script that was written to use MySQL, so
>>>> that it will work with an MSAccess MDB file.
>>>>
>>>> An important part of the script makes use of the SQL "LIMIT" keyword
>>>> available in MySQL. eg: "SELECT MyField FROM MyTable LIMIT 40,10" to
>>>> select 10 records beginning at the 41st record.
>>>>
>>>> Can anyone tell me how I can achieve this same functionality when
>>>> using ODBC functions to access an MDB file? I think I can set ROWCOUNT
>>>> (or possibly TOP) to retrieve only 10 records but how do I get it to
>>>> start at the 41st record?
>>>
>>> You just lost an enormous amount of functionality. I'm assuming this is
>>> something you had to do.
>>>
>>> Pull all of the records and then programatically strip out the records
>>> you don't want from the array.
>>
>> are you out of your fucking mind?!!!
>
> I assure you I'm not... though I don't claim to be Mr. Grand Wizard PHP
> Programmer Guy.
>
>> yeah, let me pull all the records from my 55 million rowed table into a
>> php array...
>
> Can you fit 55 million rows in an Access database that's less than 2 gigs?

let me assure you, if you pull even 2MB of data into an array just to
pseudo-query (i.e. removed unwanted data) then you're not using your tools
wisely. the only thing that should be returned from ANY db is *just* the
data you want...nothing more.

>> THEN strip out the unwanted ones from the array. hell, let's just put
>> the records into a text file and pull them from there...build our own
>> php query functionality for the file. while we're at it, we'll run our
>> lil 'query' in a loop. and, for good measure...
>
> You may very well have to do that. Like I said: You/He just lost an
> enormous amount of functionality.

why?

the answer is, no, we're using the functionality afforded by a db...i.e.
writting good queries. i fail to see how using php to kill off unwanted
records actually *adds* functionality.

>> you've got to be fucking kidding...right?!!!
>
> No... An Access MDB file would simply be the wrong tool for the job unless
> you're dealing with a very small dataset.

agreed. did i just misunderstand you? the functionality loss is the choice
of db's...not in your array advice? the two seemed to be one cohesive
thought...that's how i took it anyway.

> Without a LIMIT function you have to query for the matching records with
> odbc_exec and then eliminate the unwanted data from the result set or move
> the wanted data to a new array. I don't know of any way of doing it at
> query time... and while I was looking into it when I had to use a dBase
> file as a backend for a project it was apparent that no one else did
> either.
>
> If you have a run-time solution please share it with the group. I could
> sure use it.

you can surely mimic the functionality. the easiest way is to select into a
temp table where one of the columns is an auto-number...the query then
becomes WHERE blah BETWEEN x AND n.

there are several other ways to skin that cat however.

sorry if i misunderstood you.

Re: How to use SQL "LIMIT" keyword against an MDB file

am 29.01.2008 00:09:29 von Steve

"Jerry Stuckle" wrote in message
news:7NOdnV7yzoONxgPanZ2dnUVZ_u3inZ2d@comcast.com...
> Steve wrote:
>> "Ivan Marsh" wrote in message
>> news:pan.2008.01.28.21.50.48.197643@you.now...
>>> On Mon, 28 Jan 2008 14:37:03 -0700, Martin wrote:
>>>
>>>> I'm trying to adapt a PHP script that was written to use MySQL, so that
>>>> it will work with an MSAccess MDB file.
>>>>
>>>> An important part of the script makes use of the SQL "LIMIT" keyword
>>>> available in MySQL. eg: "SELECT MyField FROM MyTable LIMIT 40,10" to
>>>> select 10 records beginning at the 41st record.
>>>>
>>>> Can anyone tell me how I can achieve this same functionality when using
>>>> ODBC functions to access an MDB file? I think I can set ROWCOUNT (or
>>>> possibly TOP) to retrieve only 10 records but how do I get it to start
>>>> at the 41st record?
>>> You just lost an enormous amount of functionality. I'm assuming this is
>>> something you had to do.
>>>
>>> Pull all of the records and then programatically strip out the records
>>> you
>>> don't want from the array.
>>
>> are you out of your fucking mind?!!!
>>
>> yeah, let me pull all the records from my 55 million rowed table into a
>> php array...THEN strip out the unwanted ones from the array. hell, let's
>> just put the records into a text file and pull them from there...build
>> our own php query functionality for the file. while we're at it, we'll
>> run our lil 'query' in a loop. and, for good measure...
>>
>> you've got to be fucking kidding...right?!!!
>
> No, he's not. Access doesn't have the same capabilities of MySQL. You
> have to work around its limitations.

i think i just misread him, jerry.

Re: How to use SQL "LIMIT" keyword against an MDB file

am 29.01.2008 17:23:06 von Ivan Marsh

On Mon, 28 Jan 2008 17:08:29 -0600, Steve wrote:


> "Ivan Marsh" wrote in message
> news:pan.2008.01.28.22.40.54.715306@you.now...
>> On Mon, 28 Jan 2008 16:09:32 -0600, Steve wrote:
>>
>>
>>> "Ivan Marsh" wrote in message
>>> news:pan.2008.01.28.21.50.48.197643@you.now...
>>>> On Mon, 28 Jan 2008 14:37:03 -0700, Martin wrote:
>>>>
>>>>> I'm trying to adapt a PHP script that was written to use MySQL, so
>>>>> that it will work with an MSAccess MDB file.
>>>>>
>>>>> An important part of the script makes use of the SQL "LIMIT" keyword
>>>>> available in MySQL. eg: "SELECT MyField FROM MyTable LIMIT 40,10" to
>>>>> select 10 records beginning at the 41st record.
>>>>>
>>>>> Can anyone tell me how I can achieve this same functionality when
>>>>> using ODBC functions to access an MDB file? I think I can set
>>>>> ROWCOUNT (or possibly TOP) to retrieve only 10 records but how do I
>>>>> get it to start at the 41st record?
>>>>
>>>> You just lost an enormous amount of functionality. I'm assuming this
>>>> is something you had to do.
>>>>
>>>> Pull all of the records and then programatically strip out the
>>>> records you don't want from the array.
>>>
>>> are you out of your fucking mind?!!!
>>
>> I assure you I'm not... though I don't claim to be Mr. Grand Wizard PHP
>> Programmer Guy.
>>
>>> yeah, let me pull all the records from my 55 million rowed table into
>>> a php array...
>>
>> Can you fit 55 million rows in an Access database that's less than 2
>> gigs?
>
> let me assure you, if you pull even 2MB of data into an array just to
> pseudo-query (i.e. removed unwanted data) then you're not using your
> tools wisely. the only thing that should be returned from ANY db is
> *just* the data you want...nothing more.

Indeed. "All the records" in my above statement should be read "All the
records needed" not "The entire dataset". The odbc_exec query should be
used to produce the smallest dataset possible and then strip out the data
not needed.

--
I told you this was going to happen.

Re: How to use SQL "LIMIT" keyword against an MDB file

am 29.01.2008 17:55:42 von Steve

"Ivan Marsh" wrote in message
news:pan.2008.01.29.16.23.04.896088@you.now...
> On Mon, 28 Jan 2008 17:08:29 -0600, Steve wrote:
>
>
>> "Ivan Marsh" wrote in message
>> news:pan.2008.01.28.22.40.54.715306@you.now...
>>> On Mon, 28 Jan 2008 16:09:32 -0600, Steve wrote:
>>>
>>>
>>>> "Ivan Marsh" wrote in message
>>>> news:pan.2008.01.28.21.50.48.197643@you.now...
>>>>> On Mon, 28 Jan 2008 14:37:03 -0700, Martin wrote:
>>>>>
>>>>>> I'm trying to adapt a PHP script that was written to use MySQL, so
>>>>>> that it will work with an MSAccess MDB file.
>>>>>>
>>>>>> An important part of the script makes use of the SQL "LIMIT" keyword
>>>>>> available in MySQL. eg: "SELECT MyField FROM MyTable LIMIT 40,10" to
>>>>>> select 10 records beginning at the 41st record.
>>>>>>
>>>>>> Can anyone tell me how I can achieve this same functionality when
>>>>>> using ODBC functions to access an MDB file? I think I can set
>>>>>> ROWCOUNT (or possibly TOP) to retrieve only 10 records but how do I
>>>>>> get it to start at the 41st record?
>>>>>
>>>>> You just lost an enormous amount of functionality. I'm assuming this
>>>>> is something you had to do.
>>>>>
>>>>> Pull all of the records and then programatically strip out the
>>>>> records you don't want from the array.
>>>>
>>>> are you out of your fucking mind?!!!
>>>
>>> I assure you I'm not... though I don't claim to be Mr. Grand Wizard PHP
>>> Programmer Guy.
>>>
>>>> yeah, let me pull all the records from my 55 million rowed table into
>>>> a php array...
>>>
>>> Can you fit 55 million rows in an Access database that's less than 2
>>> gigs?
>>
>> let me assure you, if you pull even 2MB of data into an array just to
>> pseudo-query (i.e. removed unwanted data) then you're not using your
>> tools wisely. the only thing that should be returned from ANY db is
>> *just* the data you want...nothing more.
>
> Indeed. "All the records" in my above statement should be read "All the
> records needed" not "The entire dataset". The odbc_exec query should be
> used to produce the smallest dataset possible and then strip out the data
> not needed.

hmmm, then you're still crazy. :)

the db should be used to return *only* the data needed. there should be
nothing for you to have to strip out. what consitutues 'data needed' for the
op are only the records between x and n. getting all the records and
stripping out everything but x through n using php is ludicrous.

Re: How to use SQL "LIMIT" keyword against an MDB file

am 29.01.2008 18:52:32 von Ivan Marsh

On Tue, 29 Jan 2008 10:55:42 -0600, Steve wrote:

> "Ivan Marsh" wrote in message
> news:pan.2008.01.29.16.23.04.896088@you.now...
>> On Mon, 28 Jan 2008 17:08:29 -0600, Steve wrote:
>>> "Ivan Marsh" wrote in message
>>> news:pan.2008.01.28.22.40.54.715306@you.now...
>>>> On Mon, 28 Jan 2008 16:09:32 -0600, Steve wrote:
>>>>> "Ivan Marsh" wrote in message
>>>>> news:pan.2008.01.28.21.50.48.197643@you.now...
>>>>>> On Mon, 28 Jan 2008 14:37:03 -0700, Martin wrote:
>>>>>>
>>>>>>> I'm trying to adapt a PHP script that was written to use MySQL, so
>>>>>>> that it will work with an MSAccess MDB file.
>>>>>>>
>>>>>>> An important part of the script makes use of the SQL "LIMIT"
>>>>>>> keyword available in MySQL. eg: "SELECT MyField FROM MyTable LIMIT
>>>>>>> 40,10" to select 10 records beginning at the 41st record.
>>>>>>>
>>>>>>> Can anyone tell me how I can achieve this same functionality when
>>>>>>> using ODBC functions to access an MDB file? I think I can set
>>>>>>> ROWCOUNT (or possibly TOP) to retrieve only 10 records but how do
>>>>>>> I get it to start at the 41st record?
>>>>>>
>>>>>> You just lost an enormous amount of functionality. I'm assuming
>>>>>> this is something you had to do.
>>>>>>
>>>>>> Pull all of the records and then programatically strip out the
>>>>>> records you don't want from the array.
>>>>>
>>>>> are you out of your fucking mind?!!!
>>>>
>>>> I assure you I'm not... though I don't claim to be Mr. Grand Wizard
>>>> PHP Programmer Guy.
>>>>
>>>>> yeah, let me pull all the records from my 55 million rowed table
>>>>> into a php array...
>>>>
>>>> Can you fit 55 million rows in an Access database that's less than 2
>>>> gigs?
>>>
>>> let me assure you, if you pull even 2MB of data into an array just to
>>> pseudo-query (i.e. removed unwanted data) then you're not using your
>>> tools wisely. the only thing that should be returned from ANY db is
>>> *just* the data you want...nothing more.
>>
>> Indeed. "All the records" in my above statement should be read "All the
>> records needed" not "The entire dataset". The odbc_exec query should be
>> used to produce the smallest dataset possible and then strip out the
>> data not needed.
>
> hmmm, then you're still crazy. :)
>
> the db should be used to return *only* the data needed. there should be
> nothing for you to have to strip out. what consitutues 'data needed' for
> the op are only the records between x and n. getting all the records and
> stripping out everything but x through n using php is ludicrous.

Except you've just "solved" his issue with a database redesign. I'm
assuming if he had any say over the database design he wouldn't have moved
from MySQL to Access in the first place.

Redefining the problem isn't solving the problem.

Assume for instance the dataset he's interested in is all records that
include California in the state field. Your fix just died on the vine.

--
I told you this was going to happen.

Re: How to use SQL "LIMIT" keyword against an MDB file

am 29.01.2008 20:34:44 von Steve

"Ivan Marsh" wrote in message
news:pan.2008.01.29.17.52.30.501620@you.now...
> On Tue, 29 Jan 2008 10:55:42 -0600, Steve wrote:
>
>> "Ivan Marsh" wrote in message
>> news:pan.2008.01.29.16.23.04.896088@you.now...
>>> On Mon, 28 Jan 2008 17:08:29 -0600, Steve wrote:
>>>> "Ivan Marsh" wrote in message
>>>> news:pan.2008.01.28.22.40.54.715306@you.now...
>>>>> On Mon, 28 Jan 2008 16:09:32 -0600, Steve wrote:
>>>>>> "Ivan Marsh" wrote in message
>>>>>> news:pan.2008.01.28.21.50.48.197643@you.now...
>>>>>>> On Mon, 28 Jan 2008 14:37:03 -0700, Martin wrote:
>>>>>>>
>>>>>>>> I'm trying to adapt a PHP script that was written to use MySQL, so
>>>>>>>> that it will work with an MSAccess MDB file.
>>>>>>>>
>>>>>>>> An important part of the script makes use of the SQL "LIMIT"
>>>>>>>> keyword available in MySQL. eg: "SELECT MyField FROM MyTable LIMIT
>>>>>>>> 40,10" to select 10 records beginning at the 41st record.
>>>>>>>>
>>>>>>>> Can anyone tell me how I can achieve this same functionality when
>>>>>>>> using ODBC functions to access an MDB file? I think I can set
>>>>>>>> ROWCOUNT (or possibly TOP) to retrieve only 10 records but how do
>>>>>>>> I get it to start at the 41st record?
>>>>>>>
>>>>>>> You just lost an enormous amount of functionality. I'm assuming
>>>>>>> this is something you had to do.
>>>>>>>
>>>>>>> Pull all of the records and then programatically strip out the
>>>>>>> records you don't want from the array.
>>>>>>
>>>>>> are you out of your fucking mind?!!!
>>>>>
>>>>> I assure you I'm not... though I don't claim to be Mr. Grand Wizard
>>>>> PHP Programmer Guy.
>>>>>
>>>>>> yeah, let me pull all the records from my 55 million rowed table
>>>>>> into a php array...
>>>>>
>>>>> Can you fit 55 million rows in an Access database that's less than 2
>>>>> gigs?
>>>>
>>>> let me assure you, if you pull even 2MB of data into an array just to
>>>> pseudo-query (i.e. removed unwanted data) then you're not using your
>>>> tools wisely. the only thing that should be returned from ANY db is
>>>> *just* the data you want...nothing more.
>>>
>>> Indeed. "All the records" in my above statement should be read "All the
>>> records needed" not "The entire dataset". The odbc_exec query should be
>>> used to produce the smallest dataset possible and then strip out the
>>> data not needed.
>>
>> hmmm, then you're still crazy. :)
>>
>> the db should be used to return *only* the data needed. there should be
>> nothing for you to have to strip out. what consitutues 'data needed' for
>> the op are only the records between x and n. getting all the records and
>> stripping out everything but x through n using php is ludicrous.
>
> Except you've just "solved" his issue with a database redesign. I'm
> assuming if he had any say over the database design he wouldn't have moved
> from MySQL to Access in the first place.
>
> Redefining the problem isn't solving the problem.

however i did not redefine his problem. i eliminated the problem by taking
it out of the design. if that calls for a redesign that costs him nothing,
there's simply nothing left to consider.

> Assume for instance the dataset he's interested in is all records that
> include California in the state field. Your fix just died on the vine.

i don't see how. even if you have n criteria and different ordering, it
still works just fine.

select
into
from blah
where state = 'CA'

select
from
where id between x and n

this can also be done with one statement, bypassing the need for an
on-the-fly temp table - just sticking with original suggestion. those using
oracle know what i'm talking about...ROWNUM is a wonderful thing...esp. when
used on derived-tables/sub-queries. there are simpler solutions available to
access as well, the op just didn't state the version he was using...hence,
the lowest common denominator suggestion of temp tables.

but please, demonstrate how my fix 'just died on the vine'.

fyi, oracle:

select *
from
(
select ROWNUM section ,

from blah
where state = 'CA'
)
where section between x and n

Re: How to use SQL "LIMIT" keyword against an MDB file

am 29.01.2008 20:41:51 von Steve

"Steve" wrote in message
news:odLnj.1903$nn2.583@newsfe05.lga...
>
> "Ivan Marsh" wrote in message
> news:pan.2008.01.29.17.52.30.501620@you.now...
>> On Tue, 29 Jan 2008 10:55:42 -0600, Steve wrote:

> but please, demonstrate how my fix 'just died on the vine'.
>
> fyi, oracle:
>
> select *
> from
> (
> select ROWNUM section ,
>
> from blah
> where state = 'CA'
> )
> where section between x and n

and if you want to add macros to the mix, you can get rid of the temp table
too regardless of access version. create a macro that is called from the
query. that macro simply increments a value per record and returns the new
value as part of the query being run. from there it's just a matter of what?
value between x and n.

but, i'm still waiting on you to prove me wrong. :)

Re: How to use SQL "LIMIT" keyword against an MDB file

am 29.01.2008 20:48:17 von Jerry Stuckle

Steve wrote:
> "Ivan Marsh" wrote in message
> news:pan.2008.01.29.16.23.04.896088@you.now...
>> On Mon, 28 Jan 2008 17:08:29 -0600, Steve wrote:
>>
>>
>>> "Ivan Marsh" wrote in message
>>> news:pan.2008.01.28.22.40.54.715306@you.now...
>>>> On Mon, 28 Jan 2008 16:09:32 -0600, Steve wrote:
>>>>
>>>>
>>>>> "Ivan Marsh" wrote in message
>>>>> news:pan.2008.01.28.21.50.48.197643@you.now...
>>>>>> On Mon, 28 Jan 2008 14:37:03 -0700, Martin wrote:
>>>>>>
>>>>>>> I'm trying to adapt a PHP script that was written to use MySQL, so
>>>>>>> that it will work with an MSAccess MDB file.
>>>>>>>
>>>>>>> An important part of the script makes use of the SQL "LIMIT" keyword
>>>>>>> available in MySQL. eg: "SELECT MyField FROM MyTable LIMIT 40,10" to
>>>>>>> select 10 records beginning at the 41st record.
>>>>>>>
>>>>>>> Can anyone tell me how I can achieve this same functionality when
>>>>>>> using ODBC functions to access an MDB file? I think I can set
>>>>>>> ROWCOUNT (or possibly TOP) to retrieve only 10 records but how do I
>>>>>>> get it to start at the 41st record?
>>>>>> You just lost an enormous amount of functionality. I'm assuming this
>>>>>> is something you had to do.
>>>>>>
>>>>>> Pull all of the records and then programatically strip out the
>>>>>> records you don't want from the array.
>>>>> are you out of your fucking mind?!!!
>>>> I assure you I'm not... though I don't claim to be Mr. Grand Wizard PHP
>>>> Programmer Guy.
>>>>
>>>>> yeah, let me pull all the records from my 55 million rowed table into
>>>>> a php array...
>>>> Can you fit 55 million rows in an Access database that's less than 2
>>>> gigs?
>>> let me assure you, if you pull even 2MB of data into an array just to
>>> pseudo-query (i.e. removed unwanted data) then you're not using your
>>> tools wisely. the only thing that should be returned from ANY db is
>>> *just* the data you want...nothing more.
>> Indeed. "All the records" in my above statement should be read "All the
>> records needed" not "The entire dataset". The odbc_exec query should be
>> used to produce the smallest dataset possible and then strip out the data
>> not needed.
>
> hmmm, then you're still crazy. :)
>
> the db should be used to return *only* the data needed. there should be
> nothing for you to have to strip out. what consitutues 'data needed' for the
> op are only the records between x and n. getting all the records and
> stripping out everything but x through n using php is ludicrous.
>
>
>

Steve,

That's great when the DB gives you the tools to do so. Unfortunately,
Access is nowhere nearly as advanced as MySQL.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================

Re: How to use SQL "LIMIT" keyword against an MDB file

am 29.01.2008 21:16:16 von Steve

"Jerry Stuckle" wrote in message
news:y66dnRTY6-fDHgLanZ2dnUVZ_vDinZ2d@comcast.com...
> Steve wrote:
>> "Ivan Marsh" wrote in message
>> news:pan.2008.01.29.16.23.04.896088@you.now...
>>> On Mon, 28 Jan 2008 17:08:29 -0600, Steve wrote:
>>>
>>>
>>>> "Ivan Marsh" wrote in message
>>>> news:pan.2008.01.28.22.40.54.715306@you.now...
>>>>> On Mon, 28 Jan 2008 16:09:32 -0600, Steve wrote:
>>>>>
>>>>>
>>>>>> "Ivan Marsh" wrote in message
>>>>>> news:pan.2008.01.28.21.50.48.197643@you.now...
>>>>>>> On Mon, 28 Jan 2008 14:37:03 -0700, Martin wrote:
>>>>>>>
>>>>>>>> I'm trying to adapt a PHP script that was written to use MySQL, so
>>>>>>>> that it will work with an MSAccess MDB file.
>>>>>>>>
>>>>>>>> An important part of the script makes use of the SQL "LIMIT"
>>>>>>>> keyword
>>>>>>>> available in MySQL. eg: "SELECT MyField FROM MyTable LIMIT 40,10"
>>>>>>>> to
>>>>>>>> select 10 records beginning at the 41st record.
>>>>>>>>
>>>>>>>> Can anyone tell me how I can achieve this same functionality when
>>>>>>>> using ODBC functions to access an MDB file? I think I can set
>>>>>>>> ROWCOUNT (or possibly TOP) to retrieve only 10 records but how do I
>>>>>>>> get it to start at the 41st record?
>>>>>>> You just lost an enormous amount of functionality. I'm assuming this
>>>>>>> is something you had to do.
>>>>>>>
>>>>>>> Pull all of the records and then programatically strip out the
>>>>>>> records you don't want from the array.
>>>>>> are you out of your fucking mind?!!!
>>>>> I assure you I'm not... though I don't claim to be Mr. Grand Wizard
>>>>> PHP
>>>>> Programmer Guy.
>>>>>
>>>>>> yeah, let me pull all the records from my 55 million rowed table into
>>>>>> a php array...
>>>>> Can you fit 55 million rows in an Access database that's less than 2
>>>>> gigs?
>>>> let me assure you, if you pull even 2MB of data into an array just to
>>>> pseudo-query (i.e. removed unwanted data) then you're not using your
>>>> tools wisely. the only thing that should be returned from ANY db is
>>>> *just* the data you want...nothing more.
>>> Indeed. "All the records" in my above statement should be read "All the
>>> records needed" not "The entire dataset". The odbc_exec query should be
>>> used to produce the smallest dataset possible and then strip out the
>>> data
>>> not needed.
>>
>> hmmm, then you're still crazy. :)
>>
>> the db should be used to return *only* the data needed. there should be
>> nothing for you to have to strip out. what consitutues 'data needed' for
>> the op are only the records between x and n. getting all the records and
>> stripping out everything but x through n using php is ludicrous.
>
> Steve,
>
> That's great when the DB gives you the tools to do so. Unfortunately,
> Access is nowhere nearly as advanced as MySQL.

understood...no argument there. however, as i clarified with ivan, this is
not about access or mysql on that level. ivan suggests hacking away at a
returned dataset in php in query fashion. there simply is no reason to do so
in this case, and rarely in any other for that matter. access can certainly
be asked to provide x through n records without much fuss whatsoever. that's
what prompted the sarcastic comments initially.

Re: How to use SQL "LIMIT" keyword against an MDB file

am 29.01.2008 21:42:52 von AnrDaemon

Greetings, Ivan Marsh.
In reply to Your message dated Tuesday, January 29, 2008, 01:53:35,

>>>I'm trying to adapt a PHP script that was written to use MySQL, so
>>>that it will work with an MSAccess MDB file.
>>>
>>>An important part of the script makes use of the SQL "LIMIT" keyword
>>>available in MySQL. eg: "SELECT MyField FROM MyTable LIMIT 40,10" to
>>>select 10 records beginning at the 41st record.
>>>
>>>Can anyone tell me how I can achieve this same functionality when
>>>using ODBC functions to access an MDB file? I think I can set ROWCOUNT
>>>(or possibly TOP) to retrieve only 10 records but how do I get it to
>>>start at the 41st record?
>>
>> OK - never mind. Thanks anyway.
>>
>> I finally figured out the right words to google for and found what I
>> was looking for.

> Care to share?

SELECT [TOP n] fieldlist FROM tablelist;

Not exact replacement, but still some help...


--
Sincerely Yours, AnrDaemon

Re: How to use SQL "LIMIT" keyword against an MDB file

am 29.01.2008 21:53:32 von AnrDaemon

Greetings, Ivan Marsh.

>>>>I'm trying to adapt a PHP script that was written to use MySQL, so
>>>>that it will work with an MSAccess MDB file.
>>>>
>>>>An important part of the script makes use of the SQL "LIMIT" keyword
>>>>available in MySQL. eg: "SELECT MyField FROM MyTable LIMIT 40,10" to
>>>>select 10 records beginning at the 41st record.
>>>>
>>>>Can anyone tell me how I can achieve this same functionality when
>>>>using ODBC functions to access an MDB file? I think I can set ROWCOUNT
>>>>(or possibly TOP) to retrieve only 10 records but how do I get it to
>>>>start at the 41st record?
>>>
>>> OK - never mind. Thanks anyway.
>>>
>>> I finally figured out the right words to google for and found what I
>>> was looking for.

>> Care to share?

> SELECT [TOP n] fieldlist FROM tablelist;

> Not exact replacement, but still some help...

To add a word in the topic:
Solution (and amount of data returned by such query) is depends on Your needs.
I.e. I have started learning PHP by developing a small news feed based on MS
Access dabase.
And the query
SELECT TOP 10 * FROM [news_headers] ORDER BY [date] DESC;
were EXACTLY fits my needs.


--
Sincerely Yours, AnrDaemon

Re: How to use SQL "LIMIT" keyword against an MDB file

am 29.01.2008 23:50:58 von Steve

"AnrDaemon" wrote in message
news:1733708335.20080129235332@freemail.ru...
> Greetings, Ivan Marsh.
>
>>>>>I'm trying to adapt a PHP script that was written to use MySQL, so
>>>>>that it will work with an MSAccess MDB file.
>>>>>
>>>>>An important part of the script makes use of the SQL "LIMIT" keyword
>>>>>available in MySQL. eg: "SELECT MyField FROM MyTable LIMIT 40,10" to
>>>>>select 10 records beginning at the 41st record.
>>>>>
>>>>>Can anyone tell me how I can achieve this same functionality when
>>>>>using ODBC functions to access an MDB file? I think I can set ROWCOUNT
>>>>>(or possibly TOP) to retrieve only 10 records but how do I get it to
>>>>>start at the 41st record?
>>>>
>>>> OK - never mind. Thanks anyway.
>>>>
>>>> I finally figured out the right words to google for and found what I
>>>> was looking for.
>
>>> Care to share?
>
>> SELECT [TOP n] fieldlist FROM tablelist;
>
>> Not exact replacement, but still some help...
>
> To add a word in the topic:
> Solution (and amount of data returned by such query) is depends on Your
> needs.
> I.e. I have started learning PHP by developing a small news feed based on
> MS
> Access dabase.
> And the query
> SELECT TOP 10 * FROM [news_headers] ORDER BY [date] DESC;
> were EXACTLY fits my needs.

but doesn't get the op anywhere since he want records anywhere between the
first and nth...i.e. paged records.

Re: How to use SQL "LIMIT" keyword against an MDB file

am 30.01.2008 01:48:18 von nc

On Jan 28, 1:37 pm, Martin wrote:
>
> I'm trying to adapt a PHP script that was written to use MySQL,
> so that it will work with an MSAccess MDB file.

Good luck...

> An important part of the script makes use of the SQL "LIMIT"
> keyword available in MySQL. eg: "SELECT MyField FROM MyTable
> LIMIT 40,10" to select 10 records beginning at the 41st record.
>
> Can anyone tell me how I can achieve this same functionality
> when using ODBC functions to access an MDB file?

You can't. Access does not support LIMIT clauses.

The closet thing you can do is to run this query:

SELECT TOP 50 MyField FROM MyTable

and then loop through first 40 records returned without doing
anything and start your processing from the 41st record.

Sources:
http://office.microsoft.com/en-us/access/HA012314971033.aspx
http://office.microsoft.com/en-us/access/HA012313511033.aspx

Cheers,
NC

Re: How to use SQL "LIMIT" keyword against an MDB file

am 30.01.2008 18:34:57 von Steve

"NC" wrote in message
news:093fa743-0beb-4582-b9e2-8baaf8531f0b@s37g2000prg.google groups.com...
> On Jan 28, 1:37 pm, Martin wrote:
>>
>> I'm trying to adapt a PHP script that was written to use MySQL,
>> so that it will work with an MSAccess MDB file.
>
> Good luck...
>
>> An important part of the script makes use of the SQL "LIMIT"
>> keyword available in MySQL. eg: "SELECT MyField FROM MyTable
>> LIMIT 40,10" to select 10 records beginning at the 41st record.
>>
>> Can anyone tell me how I can achieve this same functionality
>> when using ODBC functions to access an MDB file?
>
> You can't. Access does not support LIMIT clauses.

BULLSHIT !!!

*acheive ... functionality*...the two key words. i've given an explanation
of at least one way...which falsifies your claim, btw.

> The closet thing you can do is to run this query:
>
> SELECT TOP 50 MyField FROM MyTable

BULLSHIT !!!

> and then loop through first 40 records returned without doing
> anything and start your processing from the 41st record.

more lunacy.

Re: How to use SQL "LIMIT" keyword against an MDB file

am 30.01.2008 18:44:51 von Ivan Marsh

On Wed, 30 Jan 2008 11:34:57 -0600, Steve wrote:


> "NC" wrote in message
> news:093fa743-0beb-4582-b9e2-8baaf8531f0b@s37g2000prg.google groups.com...
>> On Jan 28, 1:37 pm, Martin wrote:
>>>
>>> I'm trying to adapt a PHP script that was written to use MySQL, so
>>> that it will work with an MSAccess MDB file.
>>
>> Good luck...
>>
>>> An important part of the script makes use of the SQL "LIMIT" keyword
>>> available in MySQL. eg: "SELECT MyField FROM MyTable LIMIT 40,10" to
>>> select 10 records beginning at the 41st record.
>>>
>>> Can anyone tell me how I can achieve this same functionality when
>>> using ODBC functions to access an MDB file?
>>
>> You can't. Access does not support LIMIT clauses.
>
> BULLSHIT !!!
>
> *acheive ... functionality*...the two key words. i've given an
> explanation of at least one way...which falsifies your claim, btw.

No... you have not.

--
I told you this was going to happen.

Re: How to use SQL "LIMIT" keyword against an MDB file

am 30.01.2008 21:10:02 von Steve

"Ivan Marsh" wrote in message
news:pan.2008.01.30.17.44.49.792094@you.now...
> On Wed, 30 Jan 2008 11:34:57 -0600, Steve wrote:
>
>
>> "NC" wrote in message
>> news:093fa743-0beb-4582-b9e2-8baaf8531f0b@s37g2000prg.google groups.com...
>>> On Jan 28, 1:37 pm, Martin wrote:
>>>>
>>>> I'm trying to adapt a PHP script that was written to use MySQL, so
>>>> that it will work with an MSAccess MDB file.
>>>
>>> Good luck...
>>>
>>>> An important part of the script makes use of the SQL "LIMIT" keyword
>>>> available in MySQL. eg: "SELECT MyField FROM MyTable LIMIT 40,10" to
>>>> select 10 records beginning at the 41st record.
>>>>
>>>> Can anyone tell me how I can achieve this same functionality when
>>>> using ODBC functions to access an MDB file?
>>>
>>> You can't. Access does not support LIMIT clauses.
>>
>> BULLSHIT !!!
>>
>> *acheive ... functionality*...the two key words. i've given an
>> explanation of at least one way...which falsifies your claim, btw.
>
> No... you have not.

christ almighty!!!


the easiest way is to select into a temp table where one of the columns is
an auto-number...the query then becomes WHERE blah BETWEEN x AND n


do you need the message id too?

but while i'm at it:

===========

create table companies
(
company NUMBER ,
name TEXT ,
region NUMBER
)

SELECT *
FROM
(
SELECT (
SELECT COUNT(*)
FROM companies AS r
WHERE r.Company < co.Company
) AS RowNum ,
co.Company AS Company ,
co.Name AS Name ,
co.Region AS Region
FROM companies AS co
)
WHERE RowNum BETWEEN 50 AND 100
ORDER BY RowNum

===========

fuck you very much.

oh, that would be explanation #2...demonstrated specifically for ms access.

Re: How to use SQL "LIMIT" keyword against an MDB file

am 30.01.2008 23:27:48 von Ivan Marsh

On Wed, 30 Jan 2008 14:10:02 -0600, Steve wrote:


> "Ivan Marsh" wrote in message
> news:pan.2008.01.30.17.44.49.792094@you.now...
>> On Wed, 30 Jan 2008 11:34:57 -0600, Steve wrote:
>>
>>
>>> "NC" wrote in message
>>> news:093fa743-0beb-4582-b9e2-8baaf8531f0b@s37g2000prg.google groups.com...
>>>> On Jan 28, 1:37 pm, Martin wrote:
>>>>>
>>>>> I'm trying to adapt a PHP script that was written to use MySQL, so
>>>>> that it will work with an MSAccess MDB file.
>>>>
>>>> Good luck...
>>>>
>>>>> An important part of the script makes use of the SQL "LIMIT" keyword
>>>>> available in MySQL. eg: "SELECT MyField FROM MyTable LIMIT 40,10" to
>>>>> select 10 records beginning at the 41st record.
>>>>>
>>>>> Can anyone tell me how I can achieve this same functionality when
>>>>> using ODBC functions to access an MDB file?
>>>>
>>>> You can't. Access does not support LIMIT clauses.
>>>
>>> BULLSHIT !!!
>>>
>>> *acheive ... functionality*...the two key words. i've given an
>>> explanation of at least one way...which falsifies your claim, btw.
>>
>> No... you have not.
>
> christ almighty!!!
>
>
> the easiest way is to select into a temp table where one of the columns
> is an auto-number...the query then becomes WHERE blah BETWEEN x AND n
>

>
> do you need the message id too?
>
> but while i'm at it:
>
> ===========
>
> create table companies
> (
> company NUMBER ,
> name TEXT ,
> region NUMBER
> )
>
> SELECT *
> FROM
> (
> SELECT (
> SELECT COUNT(*)
> FROM companies AS r
> WHERE r.Company < co.Company
> ) AS RowNum ,
> co.Company AS Company ,
> co.Name AS Name ,
> co.Region AS Region
> FROM companies AS co
> )
> WHERE RowNum BETWEEN 50 AND 100 ORDER BY RowNum

....and have you verified that any of this works with PHP/ODBC hitting a
MDB file?

> fuck you very much.

I'm sorry you have a tiny dick but if you can't be civil you can kiss my
ass you two year old pansy.

--
I told you this was going to happen.

Re: How to use SQL "LIMIT" keyword against an MDB file

am 30.01.2008 23:43:09 von Paul Lautman

Ivan Marsh wrote:
> On Wed, 30 Jan 2008 14:10:02 -0600, Steve wrote:
>>
>> SELECT *
>> FROM
>> (
>> SELECT (
>> SELECT COUNT(*)
>> FROM companies AS r
>> WHERE r.Company < co.Company
>> ) AS RowNum ,
>> co.Company AS Company ,
>> co.Name AS Name ,
>> co.Region AS Region
>> FROM companies AS co
>> )
>> WHERE RowNum BETWEEN 50 AND 100 ORDER BY RowNum
>
> ...and have you verified that any of this works with PHP/ODBC hitting
> a MDB file?
He may not have bothered since he doesn't actually want to do it himself.
However, since it is indeed Microsoft's advice of how to do it, they may
well have.

Re: How to use SQL "LIMIT" keyword against an MDB file

am 31.01.2008 06:41:29 von Steve

"Ivan Marsh" wrote in message
news:pan.2008.01.30.22.27.46.903923@you.now...
> On Wed, 30 Jan 2008 14:10:02 -0600, Steve wrote:
>
>
>> "Ivan Marsh" wrote in message
>> news:pan.2008.01.30.17.44.49.792094@you.now...
>>> On Wed, 30 Jan 2008 11:34:57 -0600, Steve wrote:
>>>
>>>
>>>> "NC" wrote in message
>>>> news:093fa743-0beb-4582-b9e2-8baaf8531f0b@s37g2000prg.google groups.com...
>>>>> On Jan 28, 1:37 pm, Martin wrote:
>>>>>>
>>>>>> I'm trying to adapt a PHP script that was written to use MySQL, so
>>>>>> that it will work with an MSAccess MDB file.
>>>>>
>>>>> Good luck...
>>>>>
>>>>>> An important part of the script makes use of the SQL "LIMIT" keyword
>>>>>> available in MySQL. eg: "SELECT MyField FROM MyTable LIMIT 40,10" to
>>>>>> select 10 records beginning at the 41st record.
>>>>>>
>>>>>> Can anyone tell me how I can achieve this same functionality when
>>>>>> using ODBC functions to access an MDB file?
>>>>>
>>>>> You can't. Access does not support LIMIT clauses.
>>>>
>>>> BULLSHIT !!!
>>>>
>>>> *acheive ... functionality*...the two key words. i've given an
>>>> explanation of at least one way...which falsifies your claim, btw.
>>>
>>> No... you have not.
>>
>> christ almighty!!!
>>
>>
>> the easiest way is to select into a temp table where one of the columns
>> is an auto-number...the query then becomes WHERE blah BETWEEN x AND n
>>

>>
>> do you need the message id too?
>>
>> but while i'm at it:
>>
>> ===========
>>
>> create table companies
>> (
>> company NUMBER ,
>> name TEXT ,
>> region NUMBER
>> )
>>
>> SELECT *
>> FROM
>> (
>> SELECT (
>> SELECT COUNT(*)
>> FROM companies AS r
>> WHERE r.Company < co.Company
>> ) AS RowNum ,
>> co.Company AS Company ,
>> co.Name AS Name ,
>> co.Region AS Region
>> FROM companies AS co
>> )
>> WHERE RowNum BETWEEN 50 AND 100 ORDER BY RowNum
>
> ...and have you verified that any of this works with PHP/ODBC hitting a
> MDB file?

uhmmm, that's the funny thing about odbc...it DOESN'T have a thing to do
with queries! it is a communacative pass-thru between a caller and a db
resource. but yes, i tested it. works just fine.

>> fuck you very much.
>
> I'm sorry you have a tiny dick but if you can't be civil you can kiss my
> ass you two year old pansy.

hey, if you didn't make stupid suggestions...check that...insane suggestions
and then demonstrate that you can't read, maybe my response would be less
frank. you notice that in my second response to you, i backed off quite a
bit (almost civil in tone :) when i thought i'd just mis-understood you.
nope, you just kept forging ahead.

and, who uses the word 'pansy' anymore? sad though, that this two year old
pansy has to set your saged knoggin right.

Re: How to use SQL "LIMIT" keyword against an MDB file

am 31.01.2008 06:47:59 von Steve

"Paul Lautman" wrote in message
news:60ccruF1pqpbuU1@mid.individual.net...
> Ivan Marsh wrote:
>> On Wed, 30 Jan 2008 14:10:02 -0600, Steve wrote:
>>>
>>> SELECT *
>>> FROM
>>> (
>>> SELECT (
>>> SELECT COUNT(*)
>>> FROM companies AS r
>>> WHERE r.Company < co.Company
>>> ) AS RowNum ,
>>> co.Company AS Company ,
>>> co.Name AS Name ,
>>> co.Region AS Region
>>> FROM companies AS co
>>> )
>>> WHERE RowNum BETWEEN 50 AND 100 ORDER BY RowNum
>>
>> ...and have you verified that any of this works with PHP/ODBC hitting
>> a MDB file?
> He may not have bothered since he doesn't actually want to do it himself.
> However, since it is indeed Microsoft's advice of how to do it, they may
> well have.

usually when someone gets persistent with wanting more than theory or copy,
i work out the details and actually test it before i post it here. the only
time i don't test is when i specifically say "this should work, but i
haven't tested it".

as for microsoft's suggestion, i'm sure they would give such advice. though
the above is fully functional, it causes much overhead and doesn't scale
well. the better suggestion, though i didn't demo it here, is to create a
temp table with an additional, autonumbered field. that field would equate
to ROWNUM after inserting your SELECTed data...inclusive of condition
clauses and ordering. but, ms isn't always the best discriminator of
efficiency and effectiveness.

cheers.

Re: How to use SQL "LIMIT" keyword against an MDB file

am 31.01.2008 18:02:05 von Ivan Marsh

On Wed, 30 Jan 2008 23:41:29 -0600, Steve wrote:

> "Ivan Marsh" wrote in message
> news:pan.2008.01.30.22.27.46.903923@you.now...
>> On Wed, 30 Jan 2008 14:10:02 -0600, Steve wrote:
>>> "Ivan Marsh" wrote in message
>>> news:pan.2008.01.30.17.44.49.792094@you.now...
>>>> On Wed, 30 Jan 2008 11:34:57 -0600, Steve wrote:
>>>>> "NC" wrote in message
>>>>> news:093fa743-0beb-4582-b9e2-8baaf8531f0b@s37g2000prg.google groups.com...
>>>>>> On Jan 28, 1:37 pm, Martin wrote:
>>>>>>>
>>>>>>> I'm trying to adapt a PHP script that was written to use MySQL, so
>>>>>>> that it will work with an MSAccess MDB file.
>>>>>>
>>>>>> Good luck...
>>>>>>
>>>>>>> An important part of the script makes use of the SQL "LIMIT" keyword
>>>>>>> available in MySQL. eg: "SELECT MyField FROM MyTable LIMIT 40,10" to
>>>>>>> select 10 records beginning at the 41st record.
>>>>>>>
>>>>>>> Can anyone tell me how I can achieve this same functionality when
>>>>>>> using ODBC functions to access an MDB file?
>>>>>>
>>>>>> You can't. Access does not support LIMIT clauses.
>>>>>
>>>>> BULLSHIT !!!
>>>>>
>>>>> *acheive ... functionality*...the two key words. i've given an
>>>>> explanation of at least one way...which falsifies your claim, btw.
>>>>
>>>> No... you have not.
>>>
>>> christ almighty!!!
>>>
>>>
>>> the easiest way is to select into a temp table where one of the columns
>>> is an auto-number...the query then becomes WHERE blah BETWEEN x AND n
>>>

>>>
>>> do you need the message id too?
>>>
>>> but while i'm at it:
>>>
>>> ===========
>>>
>>> create table companies
>>> (
>>> company NUMBER ,
>>> name TEXT ,
>>> region NUMBER
>>> )
>>>
>>> SELECT *
>>> FROM
>>> (
>>> SELECT (
>>> SELECT COUNT(*)
>>> FROM companies AS r
>>> WHERE r.Company < co.Company
>>> ) AS RowNum ,
>>> co.Company AS Company ,
>>> co.Name AS Name ,
>>> co.Region AS Region
>>> FROM companies AS co
>>> )
>>> WHERE RowNum BETWEEN 50 AND 100 ORDER BY RowNum
>>
>> ...and have you verified that any of this works with PHP/ODBC hitting a
>> MDB file?
>
> uhmmm, that's the funny thing about odbc...it DOESN'T have a thing to do
> with queries! it is a communacative pass-thru between a caller and a db
> resource. but yes, i tested it. works just fine.

That's all I ask for. Your first two examples didn't work so it wouldn't
be too smart to blindly trust a third. It's funny that something you
professed to be so easy took you three attempts.

>>> fuck you very much.
>>
>> I'm sorry you have a tiny dick but if you can't be civil you can kiss my
>> ass you two year old pansy.
>
> hey, if you didn't make stupid suggestions...check that...insane suggestions
> and then demonstrate that you can't read, maybe my response would be less
> frank. you notice that in my second response to you, i backed off quite a
> bit (almost civil in tone :) when i thought i'd just mis-understood you.
> nope, you just kept forging ahead.

Why don't you try just not being an arrogant asshole in the first place?

> and, who uses the word 'pansy' anymore? sad though, that this two year
> old pansy has to set your saged knoggin right.

What's sad is that you think you have to be a dick to get your point
across. Rater than offering useful suggestions you go straight to being an
arrogant, insulting piece of crap and then it still takes you three tries
to get the code right... sort of proves my point that you don't have the
same functionality as you would with an SQL server doesn't it?

--
I told you this was going to happen.

Re: How to use SQL "LIMIT" keyword against an MDB file

am 31.01.2008 18:22:37 von Steve

"Ivan Marsh" wrote in message
news:pan.2008.01.31.17.02.03.361056@you.now...
> On Wed, 30 Jan 2008 23:41:29 -0600, Steve wrote:
>
>> "Ivan Marsh" wrote in message
>> news:pan.2008.01.30.22.27.46.903923@you.now...
>>> On Wed, 30 Jan 2008 14:10:02 -0600, Steve wrote:
>>>> "Ivan Marsh" wrote in message
>>>> news:pan.2008.01.30.17.44.49.792094@you.now...
>>>>> On Wed, 30 Jan 2008 11:34:57 -0600, Steve wrote:
>>>>>> "NC" wrote in message
>>>>>> news:093fa743-0beb-4582-b9e2-8baaf8531f0b@s37g2000prg.google groups.com...
>>>>>>> On Jan 28, 1:37 pm, Martin wrote:
>>>>>>>>
>>>>>>>> I'm trying to adapt a PHP script that was written to use MySQL, so
>>>>>>>> that it will work with an MSAccess MDB file.
>>>>>>>
>>>>>>> Good luck...
>>>>>>>
>>>>>>>> An important part of the script makes use of the SQL "LIMIT"
>>>>>>>> keyword
>>>>>>>> available in MySQL. eg: "SELECT MyField FROM MyTable LIMIT 40,10"
>>>>>>>> to
>>>>>>>> select 10 records beginning at the 41st record.
>>>>>>>>
>>>>>>>> Can anyone tell me how I can achieve this same functionality when
>>>>>>>> using ODBC functions to access an MDB file?
>>>>>>>
>>>>>>> You can't. Access does not support LIMIT clauses.
>>>>>>
>>>>>> BULLSHIT !!!
>>>>>>
>>>>>> *acheive ... functionality*...the two key words. i've given an
>>>>>> explanation of at least one way...which falsifies your claim, btw.
>>>>>
>>>>> No... you have not.
>>>>
>>>> christ almighty!!!
>>>>
>>>>
>>>> the easiest way is to select into a temp table where one of the columns
>>>> is an auto-number...the query then becomes WHERE blah BETWEEN x AND n
>>>>

>>>>
>>>> do you need the message id too?
>>>>
>>>> but while i'm at it:
>>>>
>>>> ===========
>>>>
>>>> create table companies
>>>> (
>>>> company NUMBER ,
>>>> name TEXT ,
>>>> region NUMBER
>>>> )
>>>>
>>>> SELECT *
>>>> FROM
>>>> (
>>>> SELECT (
>>>> SELECT COUNT(*)
>>>> FROM companies AS r
>>>> WHERE r.Company < co.Company
>>>> ) AS RowNum ,
>>>> co.Company AS Company ,
>>>> co.Name AS Name ,
>>>> co.Region AS Region
>>>> FROM companies AS co
>>>> )
>>>> WHERE RowNum BETWEEN 50 AND 100 ORDER BY RowNum
>>>
>>> ...and have you verified that any of this works with PHP/ODBC hitting a
>>> MDB file?
>>
>> uhmmm, that's the funny thing about odbc...it DOESN'T have a thing to do
>> with queries! it is a communacative pass-thru between a caller and a db
>> resource. but yes, i tested it. works just fine.
>
> That's all I ask for. Your first two examples didn't work so it wouldn't
> be too smart to blindly trust a third. It's funny that something you
> professed to be so easy took you three attempts.

good god, dumbass! the first suggestion works, i just didn't spell it out
with actual code. the one i showed here is the access version of the oracle
example - the second example i talked about. and, guess what? the oracle
example works fine in oracle. funny that.

every suggestion i made works. sorry if you can't read and engineer. are you
wanting a macro example too, because i said that was a third option.

again, fuck you very much.

>>>> fuck you very much.
>>>
>>> I'm sorry you have a tiny dick but if you can't be civil you can kiss my
>>> ass you two year old pansy.
>>
>> hey, if you didn't make stupid suggestions...check that...insane
>> suggestions
>> and then demonstrate that you can't read, maybe my response would be less
>> frank. you notice that in my second response to you, i backed off quite a
>> bit (almost civil in tone :) when i thought i'd just mis-understood you.
>> nope, you just kept forging ahead.
>
> Why don't you try just not being an arrogant asshole in the first place?

not arrogant, just can't stand blatant stupidity.

>> and, who uses the word 'pansy' anymore? sad though, that this two year
>> old pansy has to set your saged knoggin right.
>
> What's sad is that you think you have to be a dick to get your point
> across. Rater than offering useful suggestions you go straight to being an
> arrogant, insulting piece of crap and then it still takes you three tries
> to get the code right... sort of proves my point that you don't have the
> same functionality as you would with an SQL server doesn't it?

i don't 'think' i have to act any kind of way.

what does 'rater' mean anyway?

every suggestion i made was useful. further, i never made a comparison
between sql server, mysql, and access. i simply said LIMIT being absent from
access doesn't mean you can't get the functionality thereof...and in less
idiotic ways that you suggested. and to be clear, i gave but two pieces of
code. both work, but both are for specific db's. sorry you're an idiot. at
least i have to 'act' like a dick. you can't escape your double-digit iq,
however.

Re: How to use SQL "LIMIT" keyword against an MDB file

am 31.01.2008 18:45:25 von Ivan Marsh

On Thu, 31 Jan 2008 11:22:37 -0600, Steve wrote:


> "Ivan Marsh" wrote in message
> news:pan.2008.01.31.17.02.03.361056@you.now...
>> On Wed, 30 Jan 2008 23:41:29 -0600, Steve wrote:
>>
>>> "Ivan Marsh" wrote in message
>>> news:pan.2008.01.30.22.27.46.903923@you.now...
>>>> On Wed, 30 Jan 2008 14:10:02 -0600, Steve wrote:
>>>>> "Ivan Marsh" wrote in message
>>>>> news:pan.2008.01.30.17.44.49.792094@you.now...
>>>>>> On Wed, 30 Jan 2008 11:34:57 -0600, Steve wrote:
>>>>>>> "NC" wrote in message
>>>>>>> news:093fa743-0beb-4582-b9e2-8baaf8531f0b@s37g2000prg.google groups.com...
>>>>>>>> On Jan 28, 1:37 pm, Martin wrote:
>>>>>>>>>
>>>>>>>>> I'm trying to adapt a PHP script that was written to use MySQL,
>>>>>>>>> so that it will work with an MSAccess MDB file.
>>>>>>>>
>>>>>>>> Good luck...
>>>>>>>>
>>>>>>>>> An important part of the script makes use of the SQL "LIMIT"
>>>>>>>>> keyword
>>>>>>>>> available in MySQL. eg: "SELECT MyField FROM MyTable LIMIT
>>>>>>>>> 40,10" to
>>>>>>>>> select 10 records beginning at the 41st record.
>>>>>>>>>
>>>>>>>>> Can anyone tell me how I can achieve this same functionality
>>>>>>>>> when using ODBC functions to access an MDB file?
>>>>>>>>
>>>>>>>> You can't. Access does not support LIMIT clauses.
>>>>>>>
>>>>>>> BULLSHIT !!!
>>>>>>>
>>>>>>> *acheive ... functionality*...the two key words. i've given an
>>>>>>> explanation of at least one way...which falsifies your claim, btw.
>>>>>>
>>>>>> No... you have not.
>>>>>
>>>>> christ almighty!!!
>>>>>
>>>>>
>>>>> the easiest way is to select into a temp table where one of the
>>>>> columns is an auto-number...the query then becomes WHERE blah
>>>>> BETWEEN x AND n

>>>>>
>>>>> do you need the message id too?
>>>>>
>>>>> but while i'm at it:
>>>>>
>>>>> ===========
>>>>>
>>>>> create table companies
>>>>> (
>>>>> company NUMBER ,
>>>>> name TEXT ,
>>>>> region NUMBER
>>>>> )
>>>>>
>>>>> SELECT *
>>>>> FROM
>>>>> (
>>>>> SELECT (
>>>>> SELECT COUNT(*)
>>>>> FROM companies AS r
>>>>> WHERE r.Company < co.Company
>>>>> ) AS RowNum ,
>>>>> co.Company AS Company ,
>>>>> co.Name AS Name ,
>>>>> co.Region AS Region
>>>>> FROM companies AS co
>>>>> )
>>>>> WHERE RowNum BETWEEN 50 AND 100 ORDER BY RowNum
>>>>
>>>> ...and have you verified that any of this works with PHP/ODBC hitting
>>>> a MDB file?
>>>
>>> uhmmm, that's the funny thing about odbc...it DOESN'T have a thing to
>>> do with queries! it is a communacative pass-thru between a caller and
>>> a db resource. but yes, i tested it. works just fine.
>>
>> That's all I ask for. Your first two examples didn't work so it
>> wouldn't be too smart to blindly trust a third. It's funny that
>> something you professed to be so easy took you three attempts.
>
> good god, dumbass! the first suggestion works, i just didn't spell it
> out with actual code. the one i showed here is the access version of the
> oracle example - the second example i talked about. and, guess what? the
> oracle example works fine in oracle. funny that.
>
> every suggestion i made works. sorry if you can't read and engineer. are
> you wanting a macro example too, because i said that was a third option.
>
> again, fuck you very much.
>
>>>>> fuck you very much.
>>>>
>>>> I'm sorry you have a tiny dick but if you can't be civil you can kiss
>>>> my ass you two year old pansy.
>>>
>>> hey, if you didn't make stupid suggestions...check that...insane
>>> suggestions
>>> and then demonstrate that you can't read, maybe my response would be
>>> less frank. you notice that in my second response to you, i backed off
>>> quite a bit (almost civil in tone :) when i thought i'd just
>>> mis-understood you. nope, you just kept forging ahead.
>>
>> Why don't you try just not being an arrogant asshole in the first
>> place?
>
> not arrogant, just can't stand blatant stupidity.
>
>>> and, who uses the word 'pansy' anymore? sad though, that this two year
>>> old pansy has to set your saged knoggin right.
>>
>> What's sad is that you think you have to be a dick to get your point
>> across. Rater than offering useful suggestions you go straight to being
>> an arrogant, insulting piece of crap and then it still takes you three
>> tries to get the code right... sort of proves my point that you don't
>> have the same functionality as you would with an SQL server doesn't it?
>
> i don't 'think' i have to act any kind of way.
>
> what does 'rater' mean anyway?

It's a simple misspelling of "rather"... what does "communacative" mean?

> every suggestion i made was useful. further, i never made a comparison
> between sql server, mysql, and access. i simply said LIMIT being absent
> from access doesn't mean you can't get the functionality thereof...and
> in less idiotic ways that you suggested. and to be clear, i gave but two
> pieces of code. both work, but both are for specific db's. sorry you're
> an idiot. at least i have to 'act' like a dick. you can't escape your
> double-digit iq, however.

Once again, proving my point.

All hail Steve the Infallible... you an Thomas should date.

--
I told you this was going to happen.