473,396 Members | 1,892 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

ReLink only tables?

I'm using a relink method.It works fine but i have a question about
making it work fast.

If .Tables(tdfRelink.name).Type = "LINK" Then

in this line i put a breakpoint and look for the table
names(tdfRelink.name) but i see it includes my queries too.It checks
my queries too for linking and it makes it work slower.Is it necessary
or is it possible to pass linking queries or am i worng about that

problem is in here i guess---For Each tdfRelink In .Tables

i have about 50 tables but in line
Call SysCmd(acSysCmdInitMeter, "Tablolarla Bağlantı
Kuruluyor", .Tables.Count)
it counts about 400.
what is the thing i am missing here?
thanks for the help
*'*********************************

Public Function ReLink(strDir As String, DefaultData As Boolean) _
As Boolean

****
definitions etc.
****
Set cat = New ADOX.Catalog
With cat

'Use File Information class to extract the application
'database file name
.ActiveConnection = CurrentProject.Connection
oDBInfo2.FullName = strDir
strPath = oDBInfo2.FilePathOnly
strName = Left(oDBInfo2.Filename, InStr(oDBInfo2.Filename,
".") - 1)

'Disable error handling
On Error Resume Next

'Update progress meter
Call SysCmd(acSysCmdInitMeter, "Tablolarla Bağlantı
Kuruluyor", .Tables.Count)
'Call SysCmd(acSysCmdInitMeter,.Tables.Append

'Loop through each table, attempting to relink
For Each tdfRelink In .Tables
intCounter = intCounter + 1
Call SysCmd(acSysCmdUpdateMeter, intCounter)

If (tdfRelink.name) = "tbl_YedekDetay" Or
(tdfRelink.name) = "tbl_Zirket" Then
'Şirkete linki şirket listesi ekranında kuruluyor.
Else
If .Tables(tdfRelink.name).Type = "LINK" Then
tdfRelink.Properties("Jet OLEDB:Link Datasource")
= _
strPath & strName & IIf(DefaultData,
"Data.Mde", ".mde")
End If

End If 'tbl_YedekDetay

'If an error occurs, exit the loop
If err.number Then
Exit For
End If
Next tdfRelink
End With

Mar 8 '07 #1
2 2443
cranfan wrote:
I'm using a relink method.It works fine but i have a question about
making it work fast.

If .Tables(tdfRelink.name).Type = "LINK" Then

in this line i put a breakpoint and look for the table
names(tdfRelink.name) but i see it includes my queries too.It checks
my queries too for linking and it makes it work slower.Is it necessary
or is it possible to pass linking queries or am i worng about that

problem is in here i guess---For Each tdfRelink In .Tables

i have about 50 tables but in line
Call SysCmd(acSysCmdInitMeter, "Tablolarla Bağlantı
Kuruluyor", .Tables.Count)
it counts about 400.
what is the thing i am missing here?
thanks for the help
*'*********************************

Public Function ReLink(strDir As String, DefaultData As Boolean) _
As Boolean

****
definitions etc.
****
Set cat = New ADOX.Catalog
With cat

'Use File Information class to extract the application
'database file name
.ActiveConnection = CurrentProject.Connection
oDBInfo2.FullName = strDir
strPath = oDBInfo2.FilePathOnly
strName = Left(oDBInfo2.Filename, InStr(oDBInfo2.Filename,
".") - 1)

'Disable error handling
On Error Resume Next

'Update progress meter
Call SysCmd(acSysCmdInitMeter, "Tablolarla Bağlantı
Kuruluyor", .Tables.Count)
'Call SysCmd(acSysCmdInitMeter,.Tables.Append

'Loop through each table, attempting to relink
For Each tdfRelink In .Tables
intCounter = intCounter + 1
Call SysCmd(acSysCmdUpdateMeter, intCounter)

If (tdfRelink.name) = "tbl_YedekDetay" Or
(tdfRelink.name) = "tbl_Zirket" Then
'Şirkete linki şirket listesi ekranında kuruluyor.
Else
If .Tables(tdfRelink.name).Type = "LINK" Then
tdfRelink.Properties("Jet OLEDB:Link Datasource")
= _
strPath & strName & IIf(DefaultData,
"Data.Mde", ".mde")
End If

End If 'tbl_YedekDetay

'If an error occurs, exit the loop
If err.number Then
Exit For
End If
Next tdfRelink
End With
Here's some code I found in Google groups.
Set cat = New ADOX.Catalog
With cat
.ActiveConnection = CurrentProject.Connection
For Each tbl In .Tables
If tbl.Type = "TABLE" Then
.Tables....
End If
Next tbl
End With
Set cat = Nothing

It appears you need to check the Type.
Mar 8 '07 #2
On Mar 8, 5:16 pm, salad <o...@vinegar.comwrote:
cranfan wrote:
I'm using a relink method.It works fine but i have a question about
making it work fast.
If .Tables(tdfRelink.name).Type = "LINK" Then
in this line i put a breakpoint and look for the table
names(tdfRelink.name) but i see it includes my queries too.It checks
my queries too for linking and it makes it work slower.Is it necessary
or is it possible to pass linking queries or am i worng about that
problem is in here i guess---For Each tdfRelink In .Tables
i have about 50 tables but in line
Call SysCmd(acSysCmdInitMeter, "Tablolarla Bağlantı
Kuruluyor", .Tables.Count)
it counts about 400.
what is the thing i am missing here?
thanks for the help
*'*********************************
Public Function ReLink(strDir As String, DefaultData As Boolean) _
As Boolean
****
definitions etc.
****
Set cat = New ADOX.Catalog
With cat
'Use File Information class to extract the application
'database file name
.ActiveConnection = CurrentProject.Connection
oDBInfo2.FullName = strDir
strPath = oDBInfo2.FilePathOnly
strName = Left(oDBInfo2.Filename, InStr(oDBInfo2.Filename,
".") - 1)
'Disable error handling
On Error Resume Next
'Update progress meter
Call SysCmd(acSysCmdInitMeter, "Tablolarla Bağlantı
Kuruluyor", .Tables.Count)
'Call SysCmd(acSysCmdInitMeter,.Tables.Append
'Loop through each table, attempting to relink
For Each tdfRelink In .Tables
intCounter = intCounter + 1
Call SysCmd(acSysCmdUpdateMeter, intCounter)
If (tdfRelink.name) = "tbl_YedekDetay" Or
(tdfRelink.name) = "tbl_Zirket" Then
'Şirkete linki şirket listesi ekranında kuruluyor.
Else
If .Tables(tdfRelink.name).Type = "LINK" Then
tdfRelink.Properties("Jet OLEDB:Link Datasource")
= _
strPath & strName & IIf(DefaultData,
"Data.Mde", ".mde")
End If
End If 'tbl_YedekDetay
'If an error occurs, exit the loop
If err.number Then
Exit For
End If
Next tdfRelink
End With

Here's some code I found in Google groups.
Set cat = New ADOX.Catalog
With cat
.ActiveConnection = CurrentProject.Connection
For Each tbl In .Tables
If tbl.Type = "TABLE" Then
.Tables....
End If
Next tbl
End With
Set cat = Nothing

It appears you need to check the Type.- Hide quoted text -

- Show quoted text -
Thanks it solved my problem

Mar 9 '07 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Random Person | last post by:
Does anyone know how to use VBA to relink tables between two MS Access databases? We have two databases, one with VBA code and the other with data tables. The tables are referenced by linked...
2
by: PeteCresswell | last post by:
My code for DoCmd.TransferDatabase stopped working after applying the update in question. Seems like the last argument (optional: SaveLogInID) can no longer be specified when...
1
by: sparks | last post by:
At first I thought I could just delete the tables and import the tables. BUT my tables have relationships and I can not delete a table with relations. So that only deleted the non relational tables...
3
by: Jim | last post by:
I have a database with a front and back end setup as follows: Front: \\nt\database\NewDB\Stats.mdb = forms, reports, queries Back: "\\nt\database\NewDB\StatsData.mdb" = tables When the...
11
by: DraguVaso | last post by:
Hi, I want to make a small application in VB.NET that relinks all the query's and tables in an Access database that are linked via ODBC to an SQL Server. It must be able to relink all the tables...
0
by: DraguVaso | last post by:
Hi, I need to relink a whole bunch of Access-Linked-Tables and Pass-Through-Query's to another ODBC with VB.NET I foudn alreaddy how to relink the Tables, and I thought the query's woudl be...
4
by: Oceania | last post by:
Hi All, I did try using the sample code from the ADO.net forum to link one table, it is working fine. But, I got a problem when I tried to link all tables (20 tables)... Please help, thank...
12
by: lesperancer | last post by:
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...
1
by: Coni | last post by:
Hello, I am following steps to implement security on access 2003 through distribution: I have split the database and I am trying to distribute it: I have copied the back end file and...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.