Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Microsoft Office > Access and Access VBA > Access
Password Reminder
Register
| FAQ | Members List | Search | Today's Posts | Mark Forums Read
Access Discussion of Microsoft Access database design and programming. See also the forums for Access ASP and Access VBA.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old October 28th, 2003, 05:01 AM
Authorized User
 
Join Date: Oct 2003
Location: , , .
Posts: 53
Thanks: 0
Thanked 0 Times in 0 Posts
Default Table comparison

hi,

i have a database where i want to import files into my table.
however it is hard to stop the user from importing the same data. so i would need to import all the data into a temp table, compare the primary key of the temp table against my main table., if i found primary key matches, i will not import that row of data into my main table.
how can i do that? i really have no idea of how to start on it.

pls advice
nono

Reply With Quote
  #2 (permalink)  
Old October 28th, 2003, 10:29 AM
sal sal is offline
Friend of Wrox
 
Join Date: Oct 2003
Location: Clarksville, TN, USA.
Posts: 702
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Instead of importing why don't you link the file. After you have done the link, do a find unmatched query to find the differences and use that result to append your table.

Does that help get you started?

What typr of file are you importing? Exceel, text, csv?



Sal
Reply With Quote
  #3 (permalink)  
Old October 28th, 2003, 09:15 PM
Authorized User
 
Join Date: Oct 2003
Location: , , .
Posts: 53
Thanks: 0
Thanked 0 Times in 0 Posts
Default

hi sal,

i am importing excel files. as u have mention as to link instead of importing. if i do the linking of files, then will the data still be inserted into the database if no matches were found???

if so , can u guide me on how to link the files??

pls advice
nono

Reply With Quote
  #4 (permalink)  
Old October 28th, 2003, 09:22 PM
sal sal is offline
Friend of Wrox
 
Join Date: Oct 2003
Location: Clarksville, TN, USA.
Posts: 702
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Yes, the data can still be imported?appended to your table.
Is this an excel file that constantly changes?
are you just trying to compare the two?
I am assumming that is the case

To link go to
File
Get External Data
Link Tables
  Select Excel and search for your file

Then follow the wizard.






Sal
Reply With Quote
  #5 (permalink)  
Old October 28th, 2003, 11:26 PM
Authorized User
 
Join Date: Oct 2003
Location: , , .
Posts: 53
Thanks: 0
Thanked 0 Times in 0 Posts
Default

hi sal,

no that is not what i want. i do not want the linking to be done manually. i want it to be base on a command button click. when the user click on the command button-import, the system will import the data to a temp table and compare it with my destination table, if there are matches of the same primary key then, importing of that particular data will not be imported, while those that does not match will then be imported to the destination tables.

pls advice
nono
Reply With Quote
  #6 (permalink)  
Old October 29th, 2003, 12:14 AM
sal sal is offline
Friend of Wrox
 
Join Date: Oct 2003
Location: Clarksville, TN, USA.
Posts: 702
Thanks: 0
Thanked 0 Times in 0 Posts
Default

OK,. please tell me this.
Is this a repetitive task?
Will this be done all the time with the same Excel file?
Do you want to automate it?

Please answer all 3 questions.




Sal
Reply With Quote
  #7 (permalink)  
Old October 29th, 2003, 02:48 AM
Authorized User
 
Join Date: Oct 2003
Location: , , .
Posts: 53
Thanks: 0
Thanked 0 Times in 0 Posts
Default

hi,

- the importing will be done frequently almost everyday.
- it will not be the same excel file.
- automate in the sense that when the user want to import the file, he will go to the import form to import the data.

cheers,
nono

Reply With Quote
  #8 (permalink)  
Old October 29th, 2003, 10:36 AM
sal sal is offline
Friend of Wrox
 
Join Date: Oct 2003
Location: Clarksville, TN, USA.
Posts: 702
Thanks: 0
Thanked 0 Times in 0 Posts
Default

There are a lot of ways to import data from excel to access. The problems lies in the users not knowing anything about relational databases. To 99.99% of users, Access is a cool collection of spreadsheets.

If you have noticed, most Excel lovers do a lot of formatting to their spreadsheets (I HATE EXCEL). This makes it nearly impossible for you to predict what formatting the spreadsheet will have making it impossible to automate the task.

I have never allowed a user to import data on the fly into my database. I do not care who complains or how much they complain. I just will not allow it. It is the developer/data analyst the one responsible for importing the data.

You can not automate imports into excel the way you want to do it. You will need to do this task yourself.





Sal
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
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

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Array or Table Performance comparison bananas SQL Language 4 June 5th, 2007 05:29 AM
datetime comparison MunishBhatia ASP.NET 2.0 Professional 2 May 24th, 2007 07:42 AM
Date comparison rajuru Beginning PHP 2 February 19th, 2005 10:33 AM
Table Look Up and Comparison mmcdonal Access VBA 1 November 17th, 2004 05:28 PM
Comparison in Access mega Access ASP 1 June 23rd, 2003 12:52 AM



All times are GMT -4. The time now is 08:18 AM.


Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.