如何在 VBA 代码中的 ms-access 中执行查询? [英] How to execute a query in ms-access in VBA code?

查看:26
本文介绍了如何在 VBA 代码中的 ms-access 中执行查询?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何使用 VBA 代码执行查询以返回 ms-access 数据库中的记录?

How can I execute a query to return records in an ms-access database using VBA code?

推荐答案

看一下这个教程,了解如何在 VBA 中使用 SQL:

Take a look at this tutorial for how to use SQL inside VBA:

http://www.ehow.com/how_7148832_access-vba-query-结果.html

对于不会返回结果的查询,请使用 (此处参考):

For a query that won't return results, use (reference here):

DoCmd.RunSQL

对于一个,使用(参考这里):

Dim dBase As Database
dBase.OpenRecordset

这篇关于如何在 VBA 代码中的 ms-access 中执行查询?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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