Re: Importing Tales and Columns
- From: John W. Vinson <jvinson@xxxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Fri, 25 Jan 2008 19:36:43 -0700
On Fri, 25 Jan 2008 16:19:00 -0800, BBAL20 <BBAL20@xxxxxxxxxxxxxxxxxxxxxxxxx>
wrote:
I'm trying to import certain columns within tables via ODBC currently stored
in a SQL enviroment. I'm a beginner when it comes to VB so please forgive me.
I've wrriten the following code to import the table but I only want certain
columns within that table, not the whole table. Suggestions?
Option Compare Database
Private Sub BASE_Click()
Dim SQL_Text As String
DoCmd.TransferDatabase acImport, "ODBC Database", _
"ODBC;DSN=ODS_FDR;APP=Microsoft Office
2003;WSID=PAS-KPATTERS;DATABASE=ODS_FDR;Trusted_Connection=YES;ArrayFetchOn=1;ArrayBufferSize=8", _
acTable , "dbo.BASE", "dbo_BASE" & Format(Date, "mmddyy")
MsgBox "Data transfer to Access is complete.", vbOKOnly, "Status"
End Sub
You'll need to Link to the table (rather than importing it), and then run an
Append query to append only the selected fields into your local table.
Alternatively, create a View on the table selecting only the desired fields
(using SQL/Server's tools) and import that view rather than the table.
John W. Vinson [MVP]
.
- Follow-Ups:
- Re: Importing Tales and Columns
- From: BBAL20
- Re: Importing Tales and Columns
- Prev by Date: Re: Access 2007 and vista
- Next by Date: Re: mdb fails to open with double-click
- Previous by thread: Re: Access 2007 and vista
- Next by thread: Re: Importing Tales and Columns
- Index(es):
Relevant Pages
|