各位先進,我使用下列程式碼來重新連上之前Disconnecting的Data Source,但卻無法取回SERVER上最新的資料!!
是不是那裡錯了,敬請指教!!
Dim Conn As ADODB.Connection
Dim Rs As ADODB.Recordset
Dim Cap As String
Cap = "Data Source=" & App.Path & "\sinomed.mde;" & _
"Persist Security Info=False;" & _
"Jet OLEDB:Database"
Set Conn = New ADODB.Connection
Conn.Provider = "Microsoft.Jet.OLEDB.4.0"
Conn.ConnectionString = Cap
Conn.Open
Set Rs = New ADODB.Recordset
Rs.CursorLocation = adUseClient
Rs.Open "c:\test.dtt" '載入之前用RS.SAVE存出的RECORDSET
Set Rs.ActiveConnection = Conn
Rs.UpdateBatch '同步伺服端的資料 <--但沒有效!!
Do While Not Rs.EOF
Debug.Print Rs!篇名
Rs.MoveNext
Loop
Rs.Close
Set Rs = Nothing