如何将ADO记录集插入MS Access表 [英] How to insert ADO Recordset into MS Access Table

查看:113
本文介绍了如何将ADO记录集插入MS Access表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

问题

我想将当前记录集行插入MS Access表中.我目前收到此错误

I want to insert the current recordset row into a MS Access table. I am currently getting this error

Syntax error (missing operator) in query expression 'rs[columnname]'

代码

这是我当前的代码,我试图获取所有列并将其插入到新表中.

Here is my current code, I am trying to grab all the columns and insert them into a new table.

DoCmd.RunSQL "INSERT INTO tblSummary_Appl_Usage_score VALUES (rs[Configuration], rs[User Input / Output])"

我不太确定自己缺少什么.

I am not quite sure what i am missing.

推荐答案

如果表tblSummary_Appl_Usage_score中的类型字段是数字,请使用以下方法:

If the type fields in your table tblSummary_Appl_Usage_score are numbers, use this:

DoCmd.RunSQL "INSERT INTO tblSummary_Appl_Usage_score VALUES (" & rs![Configuration] & "," & rs![User Input / Output] & ")"

如果类型是字符串,则使用此:

If the type is string, use this:

DoCmd.RunSQL "INSERT INTO tblSummary_Appl_Usage_score VALUES (""" & rs![Configuration] & """,""" & rs![User Input / Output] & """)"

这篇关于如何将ADO记录集插入MS Access表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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