如何在导入之前映射Access字段和Excel列 [英] How do you map Access fields and Excel columns before importing

查看:83
本文介绍了如何在导入之前映射Access字段和Excel列的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我认为它被称为导入规范。

我通常从Excel电子表格导入3个文本字段(IDNo,名称和姓氏)到名为Access的表中"骑车QUOT ;.

这些字段在Excel中可能有不同的名称,即


Excel ----------------- Access

IdentityNumber --------- IDNO

名字------------名称

姓氏 - ----------姓氏


底线是Excel中的字段名称可能会有所不同,而在Access中则保持不变。


当我按下导入按钮时,我想要一个映射按钮。表格或类似的东西出现,然后我可以手动链接正确的Excel和Access字段。

任何想法是否可能以及如何完成?


我目前使用此代码从特定目录导入。我仍然需要找出文件打开函数(来自Neopa),以避免使用特定目录。

< span class =codeLinkonclick =Blur(this,this.parentNode.parentNode,getChildren(this),true);>展开 | 选择 | Wrap | 行号

解决方案

Excel导入/导出界面的灵活性非常有限。


一个选项是使用 HasFieldNames 参数集导入如果错误,但如果名称数据不适合该字段,则会导致问题,并且意味着您需要从导入的数据中删除第一条记录。


Th另一种是导入一个全新的表,然后使用查询传输数据。这将涉及确定使用了哪些字段名称的代码。之后你还想删除新表,因为它没有进一步的使用。


响应Neopa的Thx。我认为我唯一的另一个选择就是使用预先格式化的电子表格和正确的标题,然后在导入之前将数据复制/粘贴到正确的字段中。

本来很高兴有像你这样的选项拥有Outlook,在导入之前映射数据字段。


NeoPa我刚刚在互联网上看到了这个映射工具。但它不是免费的。这将是理想的。
(55.4 KB,11741 views)


I think it is called Import specification.
I usually import 3 Text fields ("IDNo" , "Name" and "Surname") from an Excel spreadsheet into an Access table called "Cyclist".
The fields may have different names in Excel ie

Excel ----------------- Access
IdentityNumber--------- IDNO
Firstname ------------ Name
Surname------------ Surname

The bottom line is that the fields in Excel may vary in name while in Access it stays the same.

When i press the Import button, i would like a "mapping" table or something similar to appear, and then i can manually link the correct Excel and Access fields.
Any ideas whether its possible and how it can be done?

I currently use this code to import from a specific directory. I still need to figure out the file open function for this (from Neopa), to avoid using a specific directory.

Expand|Select|Wrap|Line Numbers

解决方案

The flexibility of the interface for Excel importing/exporting is very limited.

One option is to import with the HasFieldNames parameter set as False, but that will cause problems if the name data doesn''t fit in the field, as well as meaning you''d need to delete the first record from the imported data.

The other is to import into a completely new table then transfer the data across using a query. This would involve code to determine which field names had been used. You''d also want to remove the new table afterwards as it would have no further use.


Thx for response Neopa. My only other option i suppose is then to use a pre-formatted spreadsheet with correct titles, and then to copy/paste data in correct fields before importing.
Would have been nice to have an option like you have in Outlook, when data fields are mapped before importing.


NeoPa i just saw this mapping tool on the internet. But its not for free. This would be ideal.
http://www.4tops.com/excelimport.htm

** Edit **

Attached Images
match.jpg (55.4 KB, 11741 views)


这篇关于如何在导入之前映射Access字段和Excel列的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆