Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Pass Through Query Access to SQL
Message
 
 
To
13/12/2002 13:51:59
General information
Forum:
Visual Basic
Category:
Database DAO/RDO/ODBC/ADO
Miscellaneous
Thread ID:
00732762
Message ID:
00734162
Views:
19
Hi!.

1. In Access, you cannot use a Pass-Through query as a View or table on another pass-through query.
What you must do is to insert the query as a sub-query in the FROM clause.
Like this.

<
SELECT a.BCHMCLASS AS Dept_ID,
a.BCHSCLASS AS TeamID,
a.BCHDESC AS Team_Name,
b.UserID,
b.USERNAME,
b.User_Name
FROM BCHSTD a,
(
SELECT b.USERNAME,
a.BCHDESC AS User_Name,
a.BCHSCLASS AS UserID,
a.BCHMCLASS AS MainID,
ltrim(RTrim(a.BCHCENTER)) AS TeamID
FROM BCHSTD a, SECUSER b
WHERE b.USERINI *= a.BCHINIT
and a.BCHMCLASS = '006'
) b
where a.BCHMCLASS = b.MainId
and a.BCHMCLASS = b.TeamId
ORDER BY a.BCHSCLASS, b.UserID;
>

2. This query won't work even on the Sql Server query analizer because it contains an outer-joined table present on a regular join.
Executing the query will return this error:
"Server: Msg 303, Level 16, State 1, Line 1
The table 'Orders' is an inner member of an outer-join clause. This is not allowed if the table also participates in a regular join clause."

3. Any query that works for Sql Server Query Analizer would work for Crystal Reports (so far I know).

4. Maybe if you use a Sub-Query in the SELECT Clause of the SELECT Statement to get the USERNAME (Because this is the only Field that needs an Outer-Join.

5. Another way to do it via Access is to link all the required tables, build the query in access and instead of outer-join use the DLOOKUP function to get the USERNAME Field.

I hope you find this helpful
Previous
Reply
Map
View

Click here to load this message in the networking platform