Results 1 to 10 of 10

Thread: [RESOLVED] Linked tables in MS Access

  1. #1

    Thread Starter
    Frenzied Member sebs's Avatar
    Join Date
    Sep 2000
    Location
    Aylmer,Qc
    Posts
    1,606

    Resolved [RESOLVED] Linked tables in MS Access

    Hey,

    I have a linked(from MS SQL Server 2K5) table in MS Access 2K and I cannot query it because it is asking me for the password everytime.

    I do not see an option to save the password in my ODBC connection nor when I link the table.

    Please tell me that there's something to do about this ?

    Thanks
    Last edited by sebs; Apr 6th, 2006 at 06:43 AM.

  2. #2
    Super Moderator si_the_geek's Avatar
    Join Date
    Jul 2002
    Location
    Bristol, UK
    Posts
    41,974

    Re: Linked tables in MS Access

    I can't remember what stage of the process it is, but the option is there as part of the linking process - I'm pretty sure it is a tick-box at the bottom of one of the screens that you go thru.

  3. #3
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    Re: Linked tables in MS Access

    Yes, there should be the option when you create the link. I believe its a checkbox that you need to check.

    It may also be in your ODBC datasource connection that you specified during the linking.
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

  4. #4

    Thread Starter
    Frenzied Member sebs's Avatar
    Join Date
    Sep 2000
    Location
    Aylmer,Qc
    Posts
    1,606

    Re: Linked tables in MS Access

    Geez, that's what I've been reading on the net, but I double triple checked and I cannot see that damm option

    I have read somewhere that you could store the password in the tabledef of the linked table, does that make sense ??

    Thanks for your help

  5. #5

    Thread Starter
    Frenzied Member sebs's Avatar
    Join Date
    Sep 2000
    Location
    Aylmer,Qc
    Posts
    1,606

    Re: Linked tables in MS Access

    Small update !

    I created my own dsn, now when I select it in the dsn list, I do not get prompt for my password, but as soon as I close MS Access and reopen it, I get prompt for it again.

    If I look in MSysObjects and I look at the Connect field, it saves everything BUT the password.

    Where can I save it ? Can I do this with Access 2000 ?

    Thanks

  6. #6
    Super Moderator si_the_geek's Avatar
    Join Date
    Jul 2002
    Location
    Bristol, UK
    Posts
    41,974

    Re: Linked tables in MS Access

    I think you need to use the "Linked Table Manager" (under "Tools"->"Database Utilities"), rather than simply selecting "Link tables..".

    Unfortunately I cant test as I haven't got that installed at the moment, and dont have permissions with this user account to install it.

  7. #7

    Thread Starter
    Frenzied Member sebs's Avatar
    Join Date
    Sep 2000
    Location
    Aylmer,Qc
    Posts
    1,606

    Re: Linked tables in MS Access

    Nah, it asked me for the password and when I put it in, it just refreshed the table.

    I need to be able to query the database thru asp.

    I found this piece of code:

    VB Code:
    1. Option Compare Database
    2.  
    3. Public Sub ChangeConnection(ByVal TableName As String, ByVal ConnectionInfo As String)
    4.    'Dim db As DAO.Database
    5.    'Dim tdf As DAO.TableDef
    6.  
    7.    Set db = CurrentDb
    8.    Set tdf = db.TableDefs(TableName)
    9.  
    10.    'Change the connect to what you need for your connection.
    11.    MsgBox tdf.connect
    12.    tdf.connect = ConnectionInfo
    13.    MsgBox tdf.connect
    14.    
    15.    Set tdf = Nothing
    16.    db.Close
    17.    Set db = Nothing
    18. End Sub
    19.  
    20. Sub test()
    21.     Call ChangeConnection("ve_forms", "connection string here")
    22. End Sub

    and I can see the new connection string on my second msgbox, but as soon as the code is doen running, it goes back to the previous string

  8. #8
    Super Moderator si_the_geek's Avatar
    Join Date
    Jul 2002
    Location
    Bristol, UK
    Posts
    41,974

    Re: Linked tables in MS Access

    Have you tried removing the linked table(s) first, then running Linked Table Manager?

  9. #9

    Thread Starter
    Frenzied Member sebs's Avatar
    Join Date
    Sep 2000
    Location
    Aylmer,Qc
    Posts
    1,606

    Re: Linked tables in MS Access

    Yeah, I just tried, it says that there's no linked tables

  10. #10

    Thread Starter
    Frenzied Member sebs's Avatar
    Join Date
    Sep 2000
    Location
    Aylmer,Qc
    Posts
    1,606

    Resolved Re: Linked tables in MS Access

    FINALLY !

    I figured it out, I used some of the code I had to backup our sql database.

    Anyway, the trick is to create the link from code:

    VB Code:
    1. DoCmd.TransferDatabase acLink, "ODBC Database", "ODBC;DRIVER=SQL Server;UID=**;PWD=**;SERVER=**;APP=Microsoft Data Access Components;", acTable, TableName, TableName, False, True

    and it store the full connection string and when I re-open my db, I do not have to enter the password !

    I am so happy right now, thanks for your help si_the_geek and RobDog888.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width