This is a discussion on "Field Name Detection" within the Databases section. This forum, and the thread "Field Name Detection are both part of the Program Your Website category.
|
|
|
|
|
![]() |
||
Field Name Detection
|
||
| Notices |
![]() |
|
|
LinkBack | Thread Tools |
|
|||
|
Field Name Detection
Hi, I have a problem.
Suppose I have one Excel file to import in the MS Access, and I will copy the content to another table. eg. File 1: Unit FileNum Code a____b______c File 2: Unit FileNum Code rs .....("File 2") rstemp.....("File 1") In VB, I will write like this: rs.Fields("Unit") = rstemp.Fields("Unit").value rs.Fields("FileNum") = rstemp.Fields("FileNum").value rs.Fields("Code") = rstemp.Fields("Code").value After that, File 2: Unit FileNum Code a____b______c But, if the File 1: Unit2 Num Code a_____b______c the Field Name is different on next time, then it doesn't work, but the content is same. How can I copy the data to File 2 even though the field name is not same, of course, we can set rs.Fields("Unit") = rstemp.Fields("Unit2").value rs.Fields("FileNum") = rstemp.Fields("Num").value rs.Fields("Code") = rstemp.Fields("Code").value But, can the program detect the column 1, column 2, column3, like that, don't need to use field name, it still can be copied to. Like that: rs.Fields("Unit") = column1.value rs.Fields("FileNum") = column2.value rs.Fields("Code") = column2.value Does anybody know how to do? Thanks a lot. Thanks. |
|
|
|
||||
|
You can also reference fields by index number.
In your case rsFields(0), rsFields(1), rsFields(2) Hope this helps
__________________
Rob - SEO Specialist Owner & Founder of Webforumz.com I am currently unavailable for private work
Last Blog Entry: Creative Labs threaten developer over home made drivers.... (Apr 1st, 2008)
|
![]() |
| Tags |
| field, name, detection |
| Thread Tools | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Browser detection IE mac | jillcary | JavaScript Forum | 1 | Aug 1st, 2007 11:28 |
| Need javascript to set input field value field | jdadwilson | JavaScript Forum | 3 | May 9th, 2007 04:47 |
| Object Detection | RobinDeanDotCom | JavaScript Forum | 4 | Sep 11th, 2006 18:30 |
| ie mac detection | jimz | JavaScript Forum | 2 | Jul 27th, 2006 22:07 |
| validate text field to db field | jtesolin | Classic ASP | 1 | Jul 18th, 2006 17:48 |