dim dt as datatable='获取Access中所有表信息
if( dt is nothing orelse dt.rows.count=0) then exit sub
for each dr as datarow in dt.rows
combobox1.items.add(new Table(dr("tableName"),dr("tableId"))
next
combobox1.DisplayMember="tableName"
combobox1.ValueMember="tableId"
------------------------------------
public class Table
private _tableName as string
private _tableId as integer
public sub new (tableName as string ,tableId as integer)
_tableName=tableName
_tableId=tableId
end sub
public readonly property TableName as string
get
return _tablename
end get
end property
public readonly property TableId as integer
get
return _tableId
end get
end property
end class
SELECT MSysObjects.Name FROM MsysObjects WHERE (Left([Name],1)<>"~") AND (Left$([Name],4) <> "Msys") AND (MSysObjects.Type)=1 ORDER BY MSysObjects.Name