获取列名 [英] Get column names

查看:53
本文介绍了获取列名的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要使用VBA或Access SQL获取表的所有列名,并通过它们进行迭代以进行验证,是否有人对此有解决方案,我搜索Google都没有用.

I need to get all of the column names of a table using VBA or Access SQL and iterate through them for validation, does anyone have a solution to this, I have searched Google to no avail.

推荐答案

这将起作用

Set db = CurrentDb()
Set rs1 = db.OpenRecordset("Table1")
Dim fld As DAO.Field
For Each fld In rs1.Fields
    MsgBox (fld.Name)
Next
Set fld = Nothing

这篇关于获取列名的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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