# Re: 请问在VB6下，如何开启 index 。（急）

Posted by 小琳小姐 on July 29, 1999 at 11:56:38:

In Reply to: Re: 请问在VB6下，如何开启 index 。（急） posted by 小琳 on July 28, 1999 at 20:52:02:

小琳小姐，您好！
首先谢谢您的回应。我的程式如下：
在ＶＢ６下的程式码是：

'以下用来开启 PEOPLE.mdb 之设定
Dim pplConn As New ADODB.Connection
Dim pplRS As New ADODB.Recordset

'以上用来开启 eMbox.mdb 之设定
Dim eMConn As New ADODB.Connection
Dim eMrseMBox As New ADODB.Recordset
Dim eMrsCounter As New ADODB.Recordset

Private Sub Form_Load()
'以下是 people.mdb 之设定
Dim pplConnStr As String '设定资料库开启变数
Dim mpplPath As String '设定路径
Dim mPW As String '设定密码变数

'以下是 eMbox.mdb 之设定
Dim eMConnStr As String
Dim eMpath As String

Me.Height = Screen.Height * 0.7
Me.Width = Screen.Width * 0.7
Me.Move (Screen.Height - Me.Height) \ 2, (Screen.Width - Me.Width) \ 2
cmdButton ("Clear")
mPW = "zhenguan"
eMpath = App.Path + "\mdb\eMbox.mdb"
eMConnStr = "Provider=Microsoft.jet.OLEDB.3.51" & _
";data source=" & eMpath
eMConn.Open eMConnStr
eMrseMBox.CursorLocation = adUseClient
'开启 eMbox.mdb
eMrseMBox.Open "eMbox", eMConn, adOpenKeyset, adLockPessimistic
'开启 counter.mdb
eMrsCounter.Open "Counter", eMConn, adOpenKeyset, adLockPessimistic
mpplPath = App.Path + "\mdb\people.mdb"
pplConnStr = "Provider=Microsoft.jet.OLEDB.3.51" & _
"; jet OLEDB:Database Password= " & mPW & _
"; Data Source=" & mpplPath
pplConn.Open pplConnStr '开启资料库
pplRS.CursorLocation = adUseClient
pplRS.Open "NameComm", pplConn, adOpenKeyset, adLockPessimistic
'开启资料表
pplRS.Index = "pplSeq"　　　　问题出在这里
Do While Not pplRS.EOF
If pplRS.Fields("MOC") = "电邮" Then
cboContact.AddItem pplRS.Fields("Cname") + Str(pplRS.Fields("pplseq"))
cboeMaddress.AddItem pplRS.Fields("NOC")
End If
pplRS.MoveNext
Loop
End Sub

如果能够得到您的帮助，那就太感激了！
我的e-mail是：forestlsw@hutchcity.com

: : 本人在ＶＢ５下曾经用下列方式开启index，但在ＶＢ６下开启郤显示”不支援
: : ”等错误讯息，请问各位高手应如何解决？
: : ＶＢ５下使用index之情况：
: : rs.index="index 名称"

: : 谢谢！

: :::既然vb6有的话，VB６也应该会有支援才对，可否将程式
: 或资料库传给小女子看看(Luo570@ms31.hinet.net)!!!

Follow Ups: