Advertisement

08.05.2003 at 01:22PM PDT, ID: 20700664
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

7.6

Create Linked Table in Access database using VB

Asked by Darebear in VB Database Programming

Tags: , , , ,

I need to create linked tables in MS Access databases.

Problem the line giving me errors is the "catdb.tables.Append tblLink" saying "-2147467259 Could not find installable ISAM". I think the Provider string is simply wrong. I need it to go through a SQL or Oracle ODBC to the database of choice.

Here's the whole function

Function CreateLinkedExternalTable(strTargetDB As String, strProviderString As String, strSourceTbl As String, strLinkTblName As String) As String
    'strTargetDB = Source Database Name     'strProviderString = Not used, currently hard coded     'strSourceTbl = Source Table name in the database we are linking too.
    'strLinkTblName = Table name we would like to see in the Access Database.
    Dim catDB As ADOX.Catalog
    Dim tblLink As ADOX.Table
    Set catDB = New ADOX.Catalog
    ' Open a Catalog on the database in which to create the link.
    catDB.ActiveConnection = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & sSourceDBFile
    If catDB.ActiveConnection.State = adStateClosed Then GoTo ErrHandler
   
    Set tblLink = New ADOX.Table
    With tblLink
        ' Name the new Table and set its ParentCatalog property to the open Catalog to allow access to the Properties collection.
        .Name = strSourceTbl
        Set .ParentCatalog = catDB
        'Set the properties to create the link.
        .Properties("Jet OLEDB:Create Link") = True
        .Properties("Jet OLEDB:Link Provider String") = "Provider=ODBC;DSN=TestODBC;DATABASE=TestDB;UID=SA;Password=xxxxx" 'strProviderString
        .Properties("Jet OLEDB:Remote Table Name") = "dbo." & strLinkTblName
    End With
    ' Append the table to the Tables collection.
    On Error Resume Next 'If table doesn't exist continue.
    catDB.Tables.Delete strSourceTbl
   
    On Error GoTo ErrHandler
    catDB.Tables.Append tblLink
    Set catDB = Nothing
   
    Exit Function
ErrHandler:
    MsgBox Err.Number & "  " & Err.Description
    Set catDB = Nothing
End Function

I would like to get either the fix to this function or a comparible piece of code.
Thank youStart Free Trial
 
Loading Advertisement...
 
[+][-]08.05.2003 at 11:29PM PDT, ID: 9086631

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]08.05.2003 at 11:31PM PDT, ID: 9086648

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zone: VB Database Programming
Tags: access, table, linked, create, vb
Sign Up Now!
Solution Provided By: appari
Participating Experts: 2
Solution Grade: A
 
 
[+][-]08.07.2003 at 05:57AM PDT, ID: 9099278

Assisted solutions are selected by the member who asked the question as a comment that contributed to their question's solution.

Start your 7-day free trial to view this Assisted Solution or ask the Experts your question.

 
[+][-]08.07.2003 at 04:48PM PDT, ID: 9104332

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32