Union Queries and OpenRecordSet Method 
Author Message
 Union Queries and OpenRecordSet Method

The follwing line of code works perfectly when I try to open a standard
query but returns an error when trying to open a Union SQL query.  Also if
I create a standard query that just extracts the Union query the code works
fine.

CODE BEGIN (Actually all on line of code - all vars Dim'd appropriately)

Set rst = DB.OpenRecordset ("Select [TaskCateg], [TaskStatus] From
        uniqCoreTaskSelect Where TaskCateg Is Not Null;", DB_OPEN_DYNASET)

CODE END

What is the difference between a standard query and a union query in this
case?  How can I modify this line of code to accept a the union query.

Thanks in advance to all who reply.

Regards,
Steve

-------------------------------------------------------------
Steve Remington - Senior Measurement & MIS Consultant
AMP Retail Financial Services - Customer Service Division
Level 7, 31-39 Macquarie Street Parramatta NSW 2150 Australia
PO Box 300 Parramatta NSW 2124 Australia
Ph: (02) 9685-6403  Fax: (02) 9685-6007

-------------------------------------------------------------



Sun, 04 Jun 2000 03:00:00 GMT  
 Union Queries and OpenRecordSet Method


Quote:
>The follwing line of code works perfectly when I try to open a standard
>query but returns an error when trying to open a Union SQL query.  Also if
>I create a standard query that just extracts the Union query the code works
>fine.

>CODE BEGIN (Actually all on line of code - all vars Dim'd appropriately)

>Set rst = DB.OpenRecordset ("Select [TaskCateg], [TaskStatus] From
> uniqCoreTaskSelect Where TaskCateg Is Not Null;", DB_OPEN_DYNASET)

>CODE END

Steve:

Union Queries can't be dynasets.  They can only be opened as snapshots.
They are not updatable.

HTH

Steve Arbaugh
ATTAC Consulting Group
web: http://ourworld.compuserve.com/homepages/attac-cg/acgsoft.htm
Reply Address adjusted to control spams remove leading ~ and NoSpm from
address



Sun, 04 Jun 2000 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Not able use openrecordset method on query using form control for criteria

2. opening a defined parameter query using openrecordset method

3. Changing Data With a Query Using OpenRecordset Method

4. VBA Excel 5.0 Union method

5. Type Mismatch error on an OpenRecordset method

6. invalid syntax in OpenRecordset method

7. openrecordset method of querydef is not a recordset?

8. OpenRecordSet method returns error

9. A2K, W2K: error 3061 with OpenRecordset method

10. Prob. w/OpenRecordset method

11. OpenRecordset method with dbAppendOnly

12. Access 2000 Qu re: openrecordset method

 

 
Powered by phpBB® Forum Software