Solved

Access - Saved Imports

Posted on 2011-02-21
7
1,074 Views
Last Modified: 2012-05-11
Hi,

I have saved import steps in Access. In previous versions of Access - I was able to view the SQL steps of the import. Please offer how I can view the SQL steps in Access 2007?

Thanks
0
Comment
Question by:tahirih
  • 3
  • 2
  • 2
7 Comments
 
LVL 84

Accepted Solution

by:
Scott McDaniel (Microsoft Access MVP - EE MVE ) earned 450 total points
ID: 34946257
Not sure if this will help, but it does show you how to run a saved import/export operation:

http://office.microsoft.com/en-us/access-help/run-a-saved-import-or-export-operation-HA001226020.aspx?CTT=3

I would assume at that point you could review the steps the operation will be using.
0
 
LVL 31

Assisted Solution

by:Helen_Feddema
Helen_Feddema earned 50 total points
ID: 34946463
What do you mean by the SQL steps?
0
 

Author Comment

by:tahirih
ID: 34947496
In former versions of Acces - when a file was imported/exported, I was able to view the SQL coding. I can no longer see this.
0
Backup Your Microsoft Windows Server®

Backup all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

 
LVL 84

Assisted Solution

by:Scott McDaniel (Microsoft Access MVP - EE MVE )
Scott McDaniel (Microsoft Access MVP - EE MVE ) earned 450 total points
ID: 34950822
There's not really any sql coding involved in importing/exporting a file.

Can you describe how you did this in earlier versions? Perhaps we would have a better understanding then.
0
 

Author Comment

by:tahirih
ID: 34952479
Actually, in thinking more - I viewed the code in SAS - so I was confused with earlier versions of Access.

Sorry for all the time this question took.

However, if by chance you know a SQL code to import/export, please feel free to share.

Thank you for everyone's efforts and time.
0
 

Author Closing Comment

by:tahirih
ID: 34952488
Thank you.
0
 
LVL 31

Expert Comment

by:Helen_Feddema
ID: 34952601
Here is some code for importing and exporting text files and Excel worksheets:
strPath = Application.CurrentProject.Path
strWorkbook= strPath & "Customers.xls"

DoCmd.TransferSpreadsheet transfertype:=acExport, _
   spreadsheettype:=acSpreadsheetTypeExcel8, _
   tablename:="qryCustomers", _
   FileName:=strWorkbook, _
   hasfieldnames:=True

DoCmd.TransferSpreadsheet transfertype:=acImport, _
   spreadsheettype:=acSpreadsheetTypeExcel9, _
   tablename:=strTable, _
   FileName:=strWorkbook, _ 
   hasfieldnames:=True, _
   Range:=strRange

========================

Private Sub cmdExportTextDelimited_Click()

   DoCmd.TransferText transfertype:=acExportDelim, _
      tablename:="tblCustomers", _
      FileName:="D:\Documents\Examples\Export Delimited.csv", _
      hasfieldnames:=True

End Sub

Private Sub cmdImportTextDelimited_Click()

   DoCmd.TransferText transfertype:=acImportDelim, _
      tablename:="tblMonthlyData", _
      FileName:="D:\Documents\Examples\Monthly Data.csv", _
      hasfieldnames:=False

End Sub

Private Sub cmdExportTextFixed_Click()

   DoCmd.TransferText transfertype:=acExportFixed, _
      hasfieldnames:=True, _
      tablename:="tblCustomersLimited", _
      specificationname:="CL", _
      FileName:="D:\Documents\Examples\Export Fixed.txt"
      
End Sub

Private Sub cmdImportTextFixed_Click()

   DoCmd.TransferText transfertype:=acImportFixed, _
      specificationname:="CL", _
      tablename:="tblImportFixed", FileName:="New Hires.txt", _
      hasfieldnames:=True

End Sub

For some imports and exports, you need a specification, which is prepared by doing the import (or export) manually, and saving the setting to a specification file (use the Advanced button in the Import Text dialog to do this).

Open in new window

0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

In the previous article, Using a Critera Form to Filter Records (http://www.experts-exchange.com/A_6069.html), the form was basically a data container storing user input, which queries and other database objects could read. The form had to remain op…
It took me quite some time to sort out all the different properties of combo and list boxes available from Visual Basic at run-time. Not that the documentation is lacking: the help pages are quite thorough and well written. The problem was rather wh…
Basics of query design. Shows you how to construct a simple query by adding tables, perform joins, defining output columns, perform sorting, and apply criteria.
In Microsoft Access, when working with VBA, learn some techniques for writing readable and easily maintained code.

895 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now