客户端程序:
Dim ConnectString As String
ConnectString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & App.Path & "\MyDatabase.mdb;User ID=Admin;Password= "
Dim Conn As New ADODB.Connection
Conn.Open ConnectString
Dim strSQL As String
strSQL = "SELECT * FROM MyTable "
Dim Rs As New ADODB.Recordset
Rs.Open strSQL, Conn
List1.Clear
Do While Rs.EOF = False
List1.AddItem Rs(0)
Rs.MoveNext
Loop
Rs.Close
Conn.Close
``` 服务器端程序: ```
Dim Conn As New ADODB.Connection
Conn.Provider = "Microsoft.Jet.OLEDB.4.0"
Conn.ConnectionString = App.Path & "/MyDatabase.mdb"
Conn.Open
Dim strSQL As String
strSQL = "SELECT * FROM MyTable "
Dim Rs As New ADODB.Recordset
Rs.Open strSQL, Conn
Do While Rs.EOF = False
'Put whatever Logic
Rs.MoveNext
Loop
Rs.Close
Conn.Close