# Re: 请问如何得知 sample.mdb 下 test 这个table 的 所有栏位名称.

Posted by yeong huann on January 28, 1999 at 02:34:42:

In Reply to: 请问如何得知 sample.mdb 下 test 这个table 的 所有栏位名称. posted by ET on January 28, 1999 at 00:50:40:

给你一段我写的片段程式,你可以参考看看,再稍做修改即可执行

Public Sub Combo1_Click()
Me.List1.Clear
Tablename = Combo1.Text
Set Mydb = Workspaces(0).OpenDatabase(Me.Text1.Text)
Set myset = Mydb.OpenRecordset(Tablename, dbOpenTable)
If myset.RecordCount = 0 Then
MsgBox "此资料表没有任何资料", 64
Else
count1 = myset.Fields.Count
For number = 0 To count1 - 1
List1.AddItem myset.Fields(number).Name
Next

End If

End Sub

Follow Ups: