views:

24

answers:

2

I have linked Sybase database table with Access 2003. I only have read access to the Sybase database and created a pass-through query in access. Now what I need is, I need to create a temp table in Access with the data output of pass-through query.

+1  A: 

If you can do a "SELECT" on that table, then you can do a "SELECT INTO" with that table.

For instance:

SELECT *
INTO myTempTable
FROM mySybaseTable

Which will copy all records from your Sybase table to your temp table.

mgroves
While this is OK for a one-time operation, if you're regularly importing the data, you really should do an append to an existing table, even if you're clearing all the data between imports. Also, if you're clearing the table between imports, the table really shouldn't be in your front end or back end, but in a separate temp mdb file so that the bloat it produces won't affect important components of your Access application.
David-W-Fenton
A: 

Another alternative is DoCmd.TransferDatabase to import the table directly, using the appropriate ODBC connect string. I don't know if it's more efficient than the INSERT INTO, but I do know that INSERT INTO can get the data types badly wrong and won't import your indexes, whereas TransferDatabase is likely to do better (though likely also not perfectly).

David-W-Fenton