如何获取Access表中的记录增量? [英] How to get an increment of records in an Access table?

查看:129
本文介绍了如何获取Access表中的记录增量?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用两个记录集将数据输入到访问表中。我为每个记录集使用了两个循环来执行此操作。我的目的是从Excel表中将数据读入表中。我的第一个记录集选择excelsheet中的所有列并执行它应该执行的操作。第二个记录集只从Excel表中选择少量列,但是当使用第二个记录集时,我只能将第一行数据传输到表中,而不能获取所有数据行。第二个记录集从表中的列号30和字段号27。第一个Recordset的格式非常相似,唯一的区别是第一个使用cStartColumn1作为for循环内函数参数的输入,第二个使用iCol,它指示光标所指向的当前列的位置。我将在这里包含第二个记录集的代码:

I am using two recordsets for inputting data into an access table. I have used two loops for each recordset to do so. My intent is to read data into the table from an Excelsheet. My first recordset selects all columns from the excelsheet and does what it is supposed to do. The second recordset selects only a handful of columns from the Excelsheet, but when using the second recordset I am only able to get the first row of data transferred into the table and not able to get all rows of data in. The second recordset starts from column number 30 and field number 27 in the table. The format of the first Recordset is very similar the only difference being that the 1st one uses cStartColumn1 as input in the function argument inside the for loop and the second one uses iCol which indicates the location of current column to which the cursor is pointing to. I will include the code for the second recordset here:

展开 | 选择 | Wrap | 行号

推荐答案

以下将数据从一个Recordset附加到另一个Record的逻辑将字段未对齐:
The following would be the Logic for Appending Data from one Recordset to another with Fields being misaligned:
展开 | 选择 | Wrap | 行号


感谢ADzeii,但我正在寻找能够将同一个表中的两个不同记录集合并到同一个表中表。因此,一个记录集包含表A中的所有字段,另一个记录集只选择表A中的几个字段。我这样做是因为我在excel中跳过两列,所以打开rst_2我只选择跳过后的列列。另一个问题是只看到我的表中显示的一行数据rst_2
Thanks ADzeii, but I am looking for is being able to merge two different recordsets from the same table into the same table. So, one recordset has all the fields in table A and the other selects only a few fields from table A. I am doing this because I am skipping two columns in excel so by opening rst_2 I am only selecting the columns that come after the skipped columns. The other problem is only seeing one row of data displayed in my table for rst_2


如何发布一些样本数据以及所需的结果?通过这种方式,我们可以更准确地了解您的要求。
How about Posting some sample Data along with the desired results? In this manner, we can get a much clearer picture of exactly what you are requesting.


这篇关于如何获取Access表中的记录增量?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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