-
06-24-2010, 07:35 AM #1Junior Member
- Ngày tham gia
- Aug 2015
- Bài viết
- 0
Cho mình hỏi về Link table qua mạng Lan với
Mình có cái Function và Sub chôm của bạn Noname,sau khi chôm được về mình có sửa chút xíu để thực hiện link table như sau :
Function getFileData(Tit As String, formatName As String, formatType As String)
Dim dlgOpen As FileDialog
Set dlgOpen = Application.FileDialog(msoFileDialogOpen)
With dlgOpen
.Title = Tit
.Filters.Clear
.Filters.Add formatName, formatType
.AllowMultiSelect = False
result = .Show
If (result <> 0) Then
getFileData = Trim(dlgOpen.SelectedItems.Item(1))
End If
End With
End Function
Sub LinkTable(p As String)
On Error Resume Next
getlink = getFileData("CUSTOMER RELATION MANAGEMENT SYSTEM", "Select Data File", "*.accdb")
If getlink <> "" Then
Set tempDB = OpenDatabase(getlink, True, False, "MS Access;PWD=" & p)
tempDB.NewPassword p, ""
tempDB.Close
Set tempDB = OpenDatabase(getlink)
For Each td In tempDB.TableDefs
strTDef = td.Name
If Left(strTDef, 4) <> "MSys" Then
DoCmd.TransferDatabase acLink, "Microsoft Access", tempDB.Name, acTable, strTDef, strTDef, True
End If
Next
tempDB.Close
Set tempDB = OpenDatabase(getlink, True, False, "MS Access;PWD=" & p)
tempDB.NewPassword "", p
tempDB.Close
Set tempDB = Nothing
End If
End Sub
Sau đó mình tạo 1 command button chạy cái Sub trên, chạy ngon lành nếu file Back End trên cùng máy với Front End ,nhưng không có tác dụng khi link Back End qua mạng Lan.
Giúp mình lý giải vì sao với nhé .
Thanks !!!!!!View more random threads:
- Cách kết hợp VBA với access
- Chèn dòng trong Form Access
- Giúp mình về câu lệnh thống kê từ ngày này đến ngày kia
- Convert font VNI sang UNI trong ACCESS!
- Randomize số trong Access
- nhập liệu cho access
- Không cập nhật được khi tiến hành Append rồi Delete
- Giúp mình cập nhập dữ liệu tự động
- Giúp đỡ về truy vấn
- Access xem giúp mình bài tính đơn giá này,tạo bảng table lấy dữ liệu từ table khác
Các mẫu cột cổng đá đẹp nhất được làm từ đá xanh tự nhiên có độ bền coi như vĩnh cửu dù cột đá được đặt ngoài hiên có thể chịu mưa , chịu nắng. Mẫu mã đẹp nhất, chạm khắc hoa văn đẹp, tinh tế. ...
Mẫu mẫu cột cổng đá được làm bằng đá xanh tự nhiên đẹp nhất hiện nay