MS Access LAST Statement

  • Thread starter Thread starter Stewart Saathoff
  • Start date Start date
S

Stewart Saathoff

Hello everyone,

I am trying to port an application from access to .Net but I still want to
use the access mdb file for the backend.

I use the LAST statement in access in one particular and .Net doesn't seem
to accept that. How do I port this statement:

LAST(SELECT * FROM MyTable)

Thanks
 
Hi Stewart,

I think you should use DataReader to iterate through all records till the
last one - not very fast
Or, you should order your select descending and fetch just the first record.
I don't think that there is a better way.
 
¤ Hello everyone,
¤
¤ I am trying to port an application from access to .Net but I still want to
¤ use the access mdb file for the backend.
¤
¤ I use the LAST statement in access in one particular and .Net doesn't seem
¤ to accept that. How do I port this statement:
¤
¤ LAST(SELECT * FROM MyTable)

Shouldn't be a problem. Could you post your code (connection string and line of code) and identify
the error you are receiving.


Paul ~~~ (e-mail address removed)
Microsoft MVP (Visual Basic)
 
Hi Paul,

Are you sure this statament is correct?
Shouldn't be something like SELECT Last(Field) FROM MyTable?

--
Miha Markic - RightHand .NET consulting & software development
miha at rthand com

 
On Wed, 19 Nov 2003 16:34:12 +0100, "Miha Markic" <miha at rthand com> wrote:

¤ Hi Paul,
¤
¤ Are you sure this statament is correct?
¤ Shouldn't be something like SELECT Last(Field) FROM MyTable?

Hi Miha,

Yes, I see what you mean. It looks like his syntax is incorrect if the statement he posted is
actually what he's attempting to execute.


Paul ~~~ (e-mail address removed)
Microsoft MVP (Visual Basic)
 
I looked into it more and I was trying to retive an entire record in the
last row of a table. SELECT Last * FROM MyTable would be sufficient, but it
only pulls one field, not the entire record. I found a workaround for my
example that doesn't require me to select the last record, but to retrieve a
record that exists with a null value in a certain field. Thanks for all of
your help though.

Stewart

 
Back
Top