# Re: 请问各位用ADO如何去开启.MDB或.DBF档呢？

Posted by Oscar on November 27, 1998 at 13:14:31:

In Reply to: 请问各位用ADO如何去开启.MDB或.DBF档呢？ posted by 蓓蓓 on November 27, 1998 at 11:59:19:

: 请问大家在VB中使用ADO的写法去连资料库时，如果Data Source是MDB档，那程式码中cn.open cnnstr（cn是一个connection物件，cnnstr是连接字串）这个连接字串要如何写呢？是否能示范如何传回一个recordset?

Dim mdbConnect As New ADODB.Connection
Dim rsUser As New ADODB.Recordset
mdbConnect.Provider = "Microsoft.Jet.OLEDB.3.51"
mdbConnect.Open "\\sqlsrv1\appsys\zipcode.mdb", "admin", ""
rsUser.ActiveConnection = mdbConnect
rsUser.Open "zipcode", , adOpenDynamic, adLockPessimistic, adCmdTable

以上程式可执行, 但索引不知如何开

Follow Ups: