# Re: 想请问各位VB高手~~~~*^_^*

Posted by 尧 哥 on September 10, 1998 at 07:32:40:

In Reply to: 想请问各位VB高手~~~~*^_^* posted by 迷惘的~~~鸡嫂 on September 09, 1998 at 19:33:47:

在form上加入一个listbox,在属性视窗中加入部门AA及BB(可以加更多CC,DD......),在加入一个data1,及dbgrid1把dbgrid1 属性视窗中的datasource 指定为data1

一般:
dim db as database
dim rs as recordset
dim dbpath as string

Private Sub Form_Load()
DBPATH="C:\WENHSIU"
SET db=opendatabase(dbpath)
End Sub
Private Sub List1_Click()
set rs=db.openrecordset(list1.text)
set data1.recordset=rs
End Sub

Follow Ups: