If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Can I return multiple tables using Access 2000?
Is it possible to bind multiple datatable in one SQL statement?
Some thing like this stored procedure for example that returns three results: select * from table1 select * from table2 select * from table3 This syntax is not working like it is on access. Is there a way to get the same job done on Access 2000? Thanks. |
#2
|
|||
|
|||
Can I return multiple tables using Access 2000?
No, there's no way of combining SQL statements like that.
You have to treat them as 3 separate statements. -- Doug Steele, Microsoft Access MVP http://I.Am/DougSteele (no e-mails, please!) wrote in message om... Is it possible to bind multiple datatable in one SQL statement? Some thing like this stored procedure for example that returns three results: select * from table1 select * from table2 select * from table3 This syntax is not working like it is on access. Is there a way to get the same job done on Access 2000? Thanks. |
#3
|
|||
|
|||
Can I return multiple tables using Access 2000?
Dear Yachea:
If the three tables have the same number of columns, and the same column datatypes in the same order, you could build a union of them with an itentifying first column TableNumber, like this: SELECT 1 AS TableNumber, * FROM table1 UNION ALL SELECT 2 AS TableNumber, * FROM table2 UNION ALL SELECT 3 AS TableNumber, * FROM table3 From this query you could then perform any other query, filtering on TableNumber to get the data only from one of the 3 tables. Or you could get the data from all 3 tables taken together, or any 2 of the 3 tables. By the way, in the stored procedure this is not one SQL statement, but 3 separate statements returning 3 separate recordsets. In access, the 3 separate recordsets could be returned by putting the 3 separate statements into a macro and running the macro. Perhaps if you explain what effect you're trying to achieve I could advise you better. Tom Ellison Microsoft Access MVP Ellison Enterprises - Your One Stop IT Experts On 3 Aug 2004 14:46:25 -0700, wrote: Is it possible to bind multiple datatable in one SQL statement? Some thing like this stored procedure for example that returns three results: select * from table1 select * from table2 select * from table3 This syntax is not working like it is on access. Is there a way to get the same job done on Access 2000? Thanks. |
#4
|
|||
|
|||
Can I return multiple tables using Access 2000?
I am trying to bind multiple tables (different types of tables) in my
strongly typed dataset throw an oleDataAdapter using only one stored procedure, as I guess, it's could be done on Sql server. Is it possible then, to call a macro instead of a stored procedure from my oleDataAdapter ? Thank a lot for all your advices, Yacine. Tom Ellison wrote in message . .. Dear Yachea: If the three tables have the same number of columns, and the same column datatypes in the same order, you could build a union of them with an itentifying first column TableNumber, like this: SELECT 1 AS TableNumber, * FROM table1 UNION ALL SELECT 2 AS TableNumber, * FROM table2 UNION ALL SELECT 3 AS TableNumber, * FROM table3 From this query you could then perform any other query, filtering on TableNumber to get the data only from one of the 3 tables. Or you could get the data from all 3 tables taken together, or any 2 of the 3 tables. By the way, in the stored procedure this is not one SQL statement, but 3 separate statements returning 3 separate recordsets. In access, the 3 separate recordsets could be returned by putting the 3 separate statements into a macro and running the macro. Perhaps if you explain what effect you're trying to achieve I could advise you better. Tom Ellison Microsoft Access MVP Ellison Enterprises - Your One Stop IT Experts |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Useless Access 2003 | tired, angry, sucidial and bored | General Discussion | 10 | July 21st, 2004 11:52 PM |
Need help with Access decision | aualias | General Discussion | 23 | June 21st, 2004 02:04 AM |
Access 2000 Table Locked | bpoteet | General Discussion | 3 | June 18th, 2004 04:36 AM |
Multiple Many-To-Many Tables | Tom | Database Design | 7 | May 15th, 2004 03:47 AM |