Ms access 如何将Visual Basic 6组合框与Microsoft Access 2007表中的字段链接

Ms access 如何将Visual Basic 6组合框与Microsoft Access 2007表中的字段链接,ms-access,vb6,combobox,database-connection,Ms Access,Vb6,Combobox,Database Connection,Microsoft Access 2007中有一个教师表。我想在VB6中获得所有教师的名字,从Tch_name字段到一个组合框列表。是否需要创建循环?谁能帮帮我吗 感谢感谢您的贡献--我确实投票支持了它,因为这是我将使用的方法(尽管我可能会使用字段名,而不是AddItem循环中的序号)。新用户学习曲线上的下一个作业是“代码格式”。 dim db as new adodb.connection 'then open your database with db connection

Microsoft Access 2007中有一个教师表。我想在VB6中获得所有教师的名字,从Tch_name字段到一个组合框列表。是否需要创建循环?谁能帮帮我吗

感谢

感谢您的贡献--我确实投票支持了它,因为这是我将使用的方法(尽管我可能会使用字段名,而不是AddItem循环中的序号)。新用户学习曲线上的下一个作业是“代码格式”。
 dim db as new adodb.connection

    'then open your database with db connection
    dim r as new adodb.recordset
    r.open "select Name from Teacher", db, adopendynamic, adlockoptimistic, adcmdtext

    'I guess column name is Name
    do while not r.eof
        combo1.additem(r.fields(0))
        r.movenext
    loop