Dim objConn As ADODB.Connection
Dim objRst As ADODB.Recordset
Dim strShape As String
strShape = "shape {select * from bankact order by acct_no} " _
& "append ({select * from " & strTable1 & " order by acct_no} " _
& "relate acct_no to pay_acct) as cmdr03 "
Set objConn = New ADODB.Connection
Set objRst = New ADODB.Recordset
Dim strFile As String
strFile = App.Path & "\data\mel.mdb"
With objConn
.Provider = "MSDataShape"
  .Open "Data Source=" & strFile & ";DataProvider=Microsoft.Jet.OLEDB.4.0"
End With
With objRst
    .CursorLocation = adUseClient
    .Open strShape, objConn, adOpenStatic,adLockReadOnly
為何執行此行open時出現
執行階段錯誤 -2147217904 open方法('_Recordset物件)失敗?
End With
  Set DRr03.DataSource = objRst
  With DRr03.Sections("Group_Head")
    .Controls("Hacct_no").DataField = "acct_no"
arrow
arrow
    全站熱搜

    vbqa 發表在 痞客邦 留言(1) 人氣()