Wrox Programmer Forums
|
Access Discussion of Microsoft Access database design and programming. See also the forums for Access ASP and Access VBA.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old January 3rd, 2008, 02:08 AM
Authorized User
 
Join Date: Jun 2004
Posts: 60
Thanks: 0
Thanked 0 Times in 0 Posts
Default temp table in query

Can I create a temp table variable in access 2003-07 as we can create in SQL server?

and is there any system defined variable in ms access i.e @@variablename etc... ?


regards.
__________________
Stay Beautiful,
Abdul Salam
 
Old January 4th, 2008, 04:50 PM
Friend of Wrox
 
Join Date: Mar 2004
Posts: 3,069
Thanks: 0
Thanked 10 Times in 10 Posts
Default

Normally a stored procedure or advanced query in SQL Server would be done with VBA code and actual local tables in Access. There are several ways to create a table and then use it, and then delete it using code. Generally I just create the table and then use it as needed and then delete everything from it when done.

What sort of transactions do you want to create in Access?



mmcdonal

Look it up at: http://wrox.books24x7.com
 
Old January 5th, 2008, 02:37 AM
Authorized User
 
Join Date: Jun 2004
Posts: 60
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thank you for answer...

Actually i want to solve problem which i have posted earlier " http://p2p.wrox.com/topic.asp?TOPIC_ID=67693 "

the reason of doing all only through query is that i am writing each n every thing in SQL Standard so it can be shifted at any other engine like Oracle, SQL Server, MS Access...


regards
 
Old January 7th, 2008, 08:37 AM
Friend of Wrox
 
Join Date: Mar 2004
Posts: 3,069
Thanks: 0
Thanked 10 Times in 10 Posts
Default

As far as I know, Access is still using SQL ANSI 89, while SQL Server 2000 uses ANSI 92, so Access sql statements are not always transportable anyway.


mmcdonal

Look it up at: http://wrox.books24x7.com
 
Old January 9th, 2008, 09:17 AM
Authorized User
 
Join Date: Jun 2004
Posts: 60
Thanks: 0
Thanked 0 Times in 0 Posts
Default

hummmm.....

then what do you suggest...
 
Old January 9th, 2008, 09:28 AM
Friend of Wrox
 
Join Date: Mar 2004
Posts: 3,069
Thanks: 0
Thanked 10 Times in 10 Posts
Default

Oracle and SQL Server use different Provider and SQL strings anyway. For example, if you want to connect to SQL Server, you would do this:

Set cn = New ADODB.Connection
cn.Open "Provider=SQLOLEDB;Data Source=ServerName;Initial Catalog=DatabaseName;UID=username;PWD=password"

Then: "SELECT * FROM MyTable"

To connect to Oracle:

Set cn = New ADODB.Connection
cn.Open "Provider=msdaora;Data Source=Instance.Domain;User ID=UserID;Password=password;"

Then: "SELECT * FROM schema.MyTable"

Etc. So syntax is always going to be an issue when you change the back end.

I would do what you need to do for the current front end/back end, and then rewrite as needed if and when a new front end/back end combination is needed.

Did that help?






mmcdonal

Look it up at: http://wrox.books24x7.com





Similar Threads
Thread Thread Starter Forum Replies Last Post
TEMP TABLE TO REAL TABLE pallone SQL Server 2000 2 June 15th, 2007 07:50 AM
How to use CTE instead of temp table jayaraj123 SQL Server 2005 0 April 25th, 2007 08:03 PM
Copy whole structure of table in #temp table maulik77 SQL Server 2000 2 December 21st, 2006 02:42 AM
Temp Table Query not returning results to page rlull SQL Server 2000 1 November 15th, 2005 04:50 PM
global temp table vs.permanent table use sofya SQL Server 2000 0 December 17th, 2004 01:57 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.