dbTalk Databases Forums  

need some info about TransferSpreadsheet acImport

comp.databases.ms-access comp.databases.ms-access


Discuss need some info about TransferSpreadsheet acImport in the comp.databases.ms-access forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
sparks
 
Posts: n/a

Default need some info about TransferSpreadsheet acImport - 09-20-2011 , 02:52 PM






DoCmd.TransferSpreadsheet acImport,


is the acimport an append or an update or either or ?

I need to import some data from excel but not sure exactly what import
does.

can it be used to append or update based on if the record exist?

thanks for any help with this

Reply With Quote
  #2  
Old   
Bob Barrows
 
Posts: n/a

Default Re: need some info about TransferSpreadsheet acImport - 09-20-2011 , 03:14 PM






sparks wrote:
Quote:
DoCmd.TransferSpreadsheet acImport,


is the acimport an append or an update or either or ?

I need to import some data from excel but not sure exactly what import
does.

can it be used to append or update based on if the record exist?

thanks for any help with this
Nope.
No update.
Insert (append) only.
You could easily have found this out for yourself using a test database and
spreadsheet.
You will need to import into a staging table and use queries to handle the
imported data after the import.

Reply With Quote
  #3  
Old   
sparks
 
Posts: n/a

Default Re: need some info about TransferSpreadsheet acImport - 09-21-2011 , 07:54 AM



I did test it and all I can get it to do is append.
I did not know if there was some way to get it to update if the record
existed or not.
It seems not.
Is there any type of import command that will do an update?


On Tue, 20 Sep 2011 16:14:46 -0400, "Bob Barrows"
<reb01501 (AT) NOyahooSPAM (DOT) com> wrote:

Quote:
sparks wrote:
DoCmd.TransferSpreadsheet acImport,


is the acimport an append or an update or either or ?

I need to import some data from excel but not sure exactly what import
does.

can it be used to append or update based on if the record exist?

thanks for any help with this

Nope.
No update.
Insert (append) only.
You could easily have found this out for yourself using a test database and
spreadsheet.
You will need to import into a staging table and use queries to handle the
imported data after the import.

Reply With Quote
  #4  
Old   
Bob Barrows
 
Posts: n/a

Default Re: need some info about TransferSpreadsheet acImport - 09-21-2011 , 08:54 AM



sparks wrote:
Quote:
I did test it and all I can get it to do is append.
So you had your answer ...

Quote:
I did not know if there was some way to get it to update if the record
existed or not.
It seems not.
Is there any type of import command that will do an update?

My answer has not changed. No.
Import the data into a staging table and use queries to handle the inserts
and updates. (same answer as my original reply). If you want more details,
we need more details (table structure, key fields, ...).

FWIW, the answer would be the same for most databases, not just Access. For
SQL Server Integration Services, there is a Merge transformation, but in its
original 2005 form, it was slow and inefficient, and most of us wound up
writing our own procedures (which usually involved staging tables). I
understand they've improved it in SQL 2008, but I haven't had a chance to
play with it.

Reply With Quote
  #5  
Old   
sparks
 
Posts: n/a

Default Re: need some info about TransferSpreadsheet acImport - 09-21-2011 , 02:51 PM



have no problems using this as an append. It works great.
I will make a blank table with the same variables and write them there
for the update queries.
I was lucky that I made the variable names in the excel file and the
database the same.
That is what made this very easy for the append part.


On Wed, 21 Sep 2011 09:54:29 -0400, "Bob Barrows"
<reb01501 (AT) NOyahooSPAM (DOT) com> wrote:

Quote:
sparks wrote:
I did test it and all I can get it to do is append.

So you had your answer ...

I did not know if there was some way to get it to update if the record
existed or not.
It seems not.
Is there any type of import command that will do an update?


My answer has not changed. No.
Import the data into a staging table and use queries to handle the inserts
and updates. (same answer as my original reply). If you want more details,
we need more details (table structure, key fields, ...).

FWIW, the answer would be the same for most databases, not just Access. For
SQL Server Integration Services, there is a Merge transformation, but in its
original 2005 form, it was slow and inefficient, and most of us wound up
writing our own procedures (which usually involved staging tables). I
understand they've improved it in SQL 2008, but I haven't had a chance to
play with it.

Reply With Quote
  #6  
Old   
ron paii
 
Posts: n/a

Default Re: need some info about TransferSpreadsheet acImport - 09-21-2011 , 03:41 PM



"sparks" <sparks (AT) home (DOT) com> wrote

Quote:
have no problems using this as an append. It works great.
I will make a blank table with the same variables and write them there
for the update queries.
I was lucky that I made the variable names in the excel file and the
database the same.
That is what made this very easy for the append part.


On Wed, 21 Sep 2011 09:54:29 -0400, "Bob Barrows"
reb01501 (AT) NOyahooSPAM (DOT) com> wrote:

sparks wrote:
I did test it and all I can get it to do is append.

So you had your answer ...

I did not know if there was some way to get it to update if the record
existed or not.
It seems not.
Is there any type of import command that will do an update?


My answer has not changed. No.
Import the data into a staging table and use queries to handle the inserts
and updates. (same answer as my original reply). If you want more details,
we need more details (table structure, key fields, ...).

FWIW, the answer would be the same for most databases, not just Access.
For
SQL Server Integration Services, there is a Merge transformation, but in
its
original 2005 form, it was slow and inefficient, and most of us wound up
writing our own procedures (which usually involved staging tables). I
understand they've improved it in SQL 2008, but I haven't had a chance to
play with it.

You may want to use a staging table as Bob suggest. All it will take for you
import to fail is someone entering a text into a numeric or date column;
which if very likely with a spreadsheet.

Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.