Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 29
Default Connection object vs. Opendatabse on Databaseobject

I have SQL that has worked using the Database Object and Recordset objects.
I have switched to a connection object in place of the database object so
that I am able to define the user and password for the DSN (please do not
suggest going DSNless, can't get it to work). In my original SQL I used the
line "Last(myDATABASE.myTABLE.myDATE) AS LastOfmyDATE". The SQL worked fine
when I used a Database object, but I'm not sure why the connection object
does not accept the "Last" functionality. The table has the MyDATE fiels
defined as date/time and I found out earlier today that the connection object
requires the SQL to be changed to enclose dates in single brackets. Not sure
if it has any bearing on the subject.
I am pulling records and I need to be able to only pull the last instance
Can anyone suggest a replacement for the last.

Thank you,

Jim

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,391
Default Connection object vs. Opendatabse on Databaseobject

James,
So you mean you changed from DAO to ADO ?
Last() is a DAO/Jet3.5 function from what I can tell.

You could RS.MoveLast, then read your data.

NickHK

"James McDowell" wrote in message
...
I have SQL that has worked using the Database Object and Recordset

objects.
I have switched to a connection object in place of the database object so
that I am able to define the user and password for the DSN (please do not
suggest going DSNless, can't get it to work). In my original SQL I used

the
line "Last(myDATABASE.myTABLE.myDATE) AS LastOfmyDATE". The SQL worked

fine
when I used a Database object, but I'm not sure why the connection object
does not accept the "Last" functionality. The table has the MyDATE fiels
defined as date/time and I found out earlier today that the connection

object
requires the SQL to be changed to enclose dates in single brackets. Not

sure
if it has any bearing on the subject.
I am pulling records and I need to be able to only pull the last instance
Can anyone suggest a replacement for the last.

Thank you,

Jim



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 29
Default Connection object vs. Opendatabse on Databaseobject

I guess the original sql was in ADO. NOT too strong in this department.
It was a query that I designed in ACCESS then copied into VBA.

The issue with the RS.MOVELAST is I am pulling more than one "event" over
time. Where the old sql would return 200 records (200 individual "events" at
their last instance), now I would get thousands of records (200 individual
events for each occurrance).

Where can I get an idea of the DAO functions available? I do not seem to
have the help files loaded on my PC. A table that showing functionality and
query types would be great.

Thank you for you help.

"NickHK" wrote:

James,
So you mean you changed from DAO to ADO ?
Last() is a DAO/Jet3.5 function from what I can tell.

You could RS.MoveLast, then read your data.

NickHK

"James McDowell" wrote in message
...
I have SQL that has worked using the Database Object and Recordset

objects.
I have switched to a connection object in place of the database object so
that I am able to define the user and password for the DSN (please do not
suggest going DSNless, can't get it to work). In my original SQL I used

the
line "Last(myDATABASE.myTABLE.myDATE) AS LastOfmyDATE". The SQL worked

fine
when I used a Database object, but I'm not sure why the connection object
does not accept the "Last" functionality. The table has the MyDATE fiels
defined as date/time and I found out earlier today that the connection

object
requires the SQL to be changed to enclose dates in single brackets. Not

sure
if it has any bearing on the subject.
I am pulling records and I need to be able to only pull the last instance
Can anyone suggest a replacement for the last.

Thank you,

Jim




  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,391
Default Connection object vs. Opendatabse on Databaseobject

James,
It would really help to see some code, as you use terms rather loosely, so
it is difficult to know how answer.

NickHK

"James McDowell" wrote in message
...
I guess the original sql was in ADO. NOT too strong in this department.
It was a query that I designed in ACCESS then copied into VBA.

The issue with the RS.MOVELAST is I am pulling more than one "event" over
time. Where the old sql would return 200 records (200 individual "events"

at
their last instance), now I would get thousands of records (200 individual
events for each occurrance).

Where can I get an idea of the DAO functions available? I do not seem to
have the help files loaded on my PC. A table that showing functionality

and
query types would be great.

Thank you for you help.

"NickHK" wrote:

James,
So you mean you changed from DAO to ADO ?
Last() is a DAO/Jet3.5 function from what I can tell.

You could RS.MoveLast, then read your data.

NickHK

"James McDowell" wrote in

message
...
I have SQL that has worked using the Database Object and Recordset

objects.
I have switched to a connection object in place of the database object

so
that I am able to define the user and password for the DSN (please do

not
suggest going DSNless, can't get it to work). In my original SQL I

used
the
line "Last(myDATABASE.myTABLE.myDATE) AS LastOfmyDATE". The SQL

worked
fine
when I used a Database object, but I'm not sure why the connection

object
does not accept the "Last" functionality. The table has the MyDATE

fiels
defined as date/time and I found out earlier today that the connection

object
requires the SQL to be changed to enclose dates in single brackets.

Not
sure
if it has any bearing on the subject.
I am pulling records and I need to be able to only pull the last

instance
Can anyone suggest a replacement for the last.

Thank you,

Jim






Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
2 Label Options - Forms Object vs Control Box Object Awrex Excel Discussion (Misc queries) 3 July 17th 09 07:10 PM
always recheck data connection library for latest connection strin FurmanGG Excel Discussion (Misc queries) 0 September 14th 07 04:48 PM
Option button object proeprties or object not found in vba Pete Straman S via OfficeKB.com Excel Programming 0 August 31st 05 05:49 PM
Confusion about how the Window object fits into the Excel object model Josh Sale Excel Programming 11 April 15th 05 06:08 PM
Excel crash closing ADO connection object Simon Gosney Excel Programming 4 March 24th 05 03:20 PM


All times are GMT +1. The time now is 08:43 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"