[AccessD] Create Temp Table from Recordset

Rocky Smolin - Beach Access Software bchacc at san.rr.com
Mon Jun 9 10:19:39 CDT 2003


MessageVlad:

I just did this by creating a make table query in the QBE and copying out the SQL code.  I don't know if you can use straight SQL to populate your table or you need to process through code.  I used db.execute instead of DoCmd.RunSQL to run the SQL so I don't have to Set Warnings False.  If you want to get rid of the table afterwards - DROP tbl.

I don't know that if your make table SQL doesn't return any records, it will create the table anyway as an empty table but I think it will.


HTH

Rocky

  ----- Original Message ----- 
  From: ACTEBS 
  To: access group 
  Sent: Monday, June 09, 2003 7:48 AM
  Subject: [AccessD] Create Temp Table from Recordset


  Guys,

  Is there a method of creating a temp table in your DB from a recordset? eg:

  dim strSQL as string
  dim db as dao.database
  dim rst as dao.recordset

  strSQL = "SELECT someTable etc etc etc"

  set db = opendatabase("some remote DB")
  set rst =db.openrecordset(strsql)

  with rst
      make a new table in my db from the recordset
  end with

  I've never had to do this and have wasted heaps of time on this. Any help will be much appreciated...

  Thanks
  Vlad



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


  _______________________________________________
  AccessD mailing list
  AccessD at databaseadvisors.com
  http://databaseadvisors.com/mailman/listinfo/accessd
  Website: http://www.databaseadvisors.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://databaseadvisors.com/pipermail/accessd/attachments/20030609/7debd92a/attachment-0001.html>


More information about the AccessD mailing list