如果可以列出MS Access表中的所有字段名称,请告诉我吗?
谢谢
解决方法
我在ms访问太多了.
我知道这样做的唯一方法是使用vba,并定义例如记录集,并循环遍历字段.
例如:
dim rst as new adodb.recordset rst.open "SELECT * FROM SoMetable",CurrentProject.Connection,adOpenForwardOnly,adLockReadOnly ' Note: adOpenForwardOnly and adLockReadOnly are the default values ' ' for the CursorType and LockType arguments,so they are optional here ' ' and are shown only for completeness ' dim ii as integer dim ss as string for ii = 0 to rst.fields.count - 1 ss = ss & "," & rst.fields(ii).name next ii
字符串变量ss将包含名为“SoMetable”的表中所有列名的逗号分隔列表.
通过稍微重新格式化逻辑,您应该能够将此数据插入到另一个表中,然后查询它.
这有帮助吗?