Problems with linked tables in Access _ Application Tips

Source: Internet
Author: User
A site that uses ASP and MDB, where a linked table is used in one MDB and linked to a table in another MDB in the current directory, so that data sharing can be achieved.
faq-it.org/delphi_win_sdk/problem, when the site to publish to the site, because the online space path and my computer is different, so the link table failed, the Web page of course can not open.
I think the solution is:
One is to create a directory structure on this computer that is exactly the same as the online space. But it's a hassle, especially if you have to change the site frequently.
One, how do you make a linked table use a relative path, that is, link to the MDB file in the current directory? (By the way, access is retarded, and the linked table records an absolute path).
Also, how do you implement a link to a linked table by programming (ASP or local VBA)? (Again, access or retarded, update linked table I can only use manual update, must find the path of the MDB to do!) But the local path is different from the Internet.

Who can tell me how to implement the latter two methods?

---------------------------------------------------------------

Here's the ADOX code I'm using, just to prove that access has this feature (it's not nice to say: This is about Access p?). This is the problem that the ADO model solves. And you also mention the wrong place, mention ASP that piece more appropriate, do access programming should understand, if you do not understand I can only say sorry.

Public Function Newlinkedexternaltablemdb ()
Dim Strtargetdb () as String
Dim strproviderstring () as String
Dim strsourcetbl () as String
Dim Strlinktblname () as String
Dim CatDB as ADOX. Catalog
Dim Tbllink as ADOX. Table
Dim Tmplink as ADOX. Table
Dim I as Integer
Dim J as Integer
Set catdb = New ADOX. Catalog
Catdb.activeconnection = CurrentProject.Connection
i = CatDB.Tables.Count
ReDim Strtargetdb (i)
ReDim strproviderstring (i)
ReDim Strsourcetbl (i)
ReDim Strlinktblname (i)
i = 1
For each tmplink in Catdb.tables
If tmplink.properties ("Jet oledb:create Link") Then
If Trim (tmplink.properties ("Jet oledb:remote Table Name") <> "" Then
Strlinktblname (i) = Tmplink.name
Strtargetdb (i) = Tmplink.properties ("Jet oledb:link Datasource")
Strproviderstring (i) = Tmplink.properties ("Jet oledb:link Provider String")
STRSOURCETBL (i) = Tmplink.properties ("Jet oledb:remote Table Name")
Do While INSTR (1, Strtargetdb (i), "/") <> 0
Strtargetdb (i) = Mid (Strtargetdb (i), InStr (1, Strtargetdb (i), "/") + 1, Len (Strtargetdb (i))
Loop
Strtargetdb (i) = Currentproject.path & "/" & Strtargetdb (i)
i = i + 1
End If
End If

Next
j = I-1
For i = 1 to J
CatDB.Tables.Delete Strlinktblname (i)
Set Tbllink = New ADOX. Table
With Tbllink
. Name = Strlinktblname (i)
Set. ParentCatalog = CatDB
. Properties ("Jet oledb:create Link") = True
. Properties ("Jet oledb:link Datasource") = Strtargetdb (i)
. Properties ("Jet oledb:link Provider String") = Strproviderstring (i)
. Properties ("Jet oledb:remote Table Name") = Strsourcetbl (i)
End With
CatDB.Tables.Append Tbllink
Set Tbllink = Nothing
Next
Set CatDB = Nothing
End Function

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.