问题描述
我有两个MDB,由于尺寸,安全性等原因,需要保留
单独
报价
配置器(将来会有更多这些)
所以在quotation.mdb,
我链接了configurator.mdb使用的所有表
我使用完整路径名创建了对configurator.mdbm的引用
我打开一个''configurator''表单,然后去工作我去了
现在这是在开发世界,当我们将应用程序移动到
生产时,我想更改
quotation.mdb中的所有configurator.mdb引用指向生产MDB使用
Public Sub linkReferences()
Dim ref作为参考
Dim lngRef As Long
Dim strPath As String
On Error GoTo fErr
for lngRef = Application.References.Count To 1 Step -1
设置ref = Application.References(lngRef)
If(Left(ref.FullPath, Len(devQuotrak))= devQuotrak)然后
If(applicationPath<> devQuotrak)然后
strPath = applicationPath&中(ref.FullPath,
Len(devQuotrak)+ 1,99)
Application.References.Remove ref
Application.References.AddFromFile strPath
结束如果
结束如果
设置ref = Nothing
下一个lngRef
f退出:
On Error Resume Next
设置ref = Nothing
退出Sub
fErr:
errorLog" linkReferences"
恢复fExit
结束子
但当我点击''Application.References.Remove ref''时,我收到一条
消息
无法进入休息模式这一次
和''删除''和''添加''没有发生
为什么会出现这个错误?
我还能做什么?
I''ve got two MDBs, that due to size, security, etc, need to be kept
separate
quotation
configurator (there will be more of these in the future)
so within quotation.mdb,
I linked all the tables that configurator.mdb uses
I created a reference to configurator.mdbm using full path name
I open a ''configurator'' form, and away to work I go
now this is in a development world, and when we move the application to
production, I''d like to change all the configurator.mdb references in
quotation.mdb to point to the production MDBs using
Public Sub linkReferences()
Dim ref As Reference
Dim lngRef As Long
Dim strPath As String
On Error GoTo fErr
For lngRef = Application.References.Count To 1 Step -1
Set ref = Application.References(lngRef)
If (Left(ref.FullPath, Len(devQuotrak)) = devQuotrak) Then
If (applicationPath <> devQuotrak) Then
strPath = applicationPath & Mid(ref.FullPath,
Len(devQuotrak) + 1, 99)
Application.References.Remove ref
Application.References.AddFromFile strPath
End If
End If
Set ref = Nothing
Next lngRef
fExit:
On Error Resume Next
Set ref = Nothing
Exit Sub
fErr:
errorLog "linkReferences"
Resume fExit
End Sub
but when I hit the line '' Application.References.Remove ref'', I get a
message
cant enter break mode at this time
and the ''remove'' and ''add'' does not happen
why this error ?
what else can I do ?
推荐答案
如果这些是链接表你改变了通过CONNECT属性链接。
例如
Public Function Relink(path1
If these are linked tables you change the links via the CONNECT property.
For example
Public Function Relink(path1
这篇关于ACCESS97,尝试重新链接对另一个MDB的引用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!