Page 1 of 2 12 LastLast
Results 1 to 15 of 19
  1. #1
    johnseito is offline Competent Performer
    Windows 7 64bit Access 2010 64bit
    Join Date
    Aug 2013
    Posts
    419

    Linking Access to SQL server

    Hello,



    Have anyone ever link Access to SQL server. And can you share some methods or suggestions.

    Access is use as front end while SQL-server is use as back end.

    Please advise !

    Thanks

  2. #2
    JoeM is offline VIP
    Windows 7 32bit Access 2007
    Join Date
    Jun 2012
    Posts
    3,904
    I did a few of those a few years back.

    Via a simple Google search: https://www.quackit.com/microsoft_ac...ccess_2016.cfm

  3. #3
    ssanfu is offline Master of Nothing
    Windows 7 32bit Access 2010 32bit
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    You might also look at the clips by Steve Bishop:

    Lesson #6
    Creating an ODBC connection to SQL Server

    Lesson #7
    Linking Tables from an ODBC connection to Access

  4. #4
    isladogs's Avatar
    isladogs is offline MVP / VIP
    Windows 10 Access 2010 32bit
    Join Date
    Jan 2014
    Location
    Somerset, UK
    Posts
    5,974
    An alternative approach involves using DSN less connections.
    This is possibly a little more tricky to setup but it avoids the need to setup the ODBC connections on each workstation running the Access FE

    For more info, see https://support.microsoft.com/en-gb/...nked-tables-in
    Colin, Access MVP, Website, email
    The more I learn, the more I know I don't know. When I don't know, I keep quiet!
    If I don't know that I don't know, I don't know whether to answer

  5. #5
    johnseito is offline Competent Performer
    Windows 7 64bit Access 2010 64bit
    Join Date
    Aug 2013
    Posts
    419
    I noticed that when I link access to sql server I need to save a data source name file some where on the share drive for other people to access it too, otherwise if is only save on locally only I could access it, other people can’t.

    How can we not use data source name and still have other people access it ?

  6. #6
    johnseito is offline Competent Performer
    Windows 7 64bit Access 2010 64bit
    Join Date
    Aug 2013
    Posts
    419
    Isladdogs, how do I set this up then, please advise ? Thanks

  7. #7
    johnseito is offline Competent Performer
    Windows 7 64bit Access 2010 64bit
    Join Date
    Aug 2013
    Posts
    419
    I want to link it where if another users doesn’t have access to the database can still see the linked data and use the program. How do I do that ?

  8. #8
    isladogs's Avatar
    isladogs is offline MVP / VIP
    Windows 10 Access 2010 32bit
    Join Date
    Jan 2014
    Location
    Somerset, UK
    Posts
    5,974
    John
    I'm not sure how many of your last 3 posts were aimed specifically at me.
    Regarding DSN less connections, did you read the link I provided?
    Here is another guide that you may find useful http://www.accessmvp.com/DJSteele/DSNLessLinks.html.

    However I haven't responded to your other points as I'm not really sure what you are asking and whether its variations on the same question.
    Perhaps you could explain again and you may then get more than one reply to your question(s)
    Thanks
    Colin, Access MVP, Website, email
    The more I learn, the more I know I don't know. When I don't know, I keep quiet!
    If I don't know that I don't know, I don't know whether to answer

  9. #9
    johnseito is offline Competent Performer
    Windows 7 64bit Access 2010 64bit
    Join Date
    Aug 2013
    Posts
    419
    Quote Originally Posted by isladogs View Post
    John
    I'm not sure how many of your last 3 posts were aimed specifically at me.
    Regarding DSN less connections, did you read the link I provided?
    Here is another guide that you may find useful http://www.accessmvp.com/DJSteele/DSNLessLinks.html.

    However I haven't responded to your other points as I'm not really sure what you are asking and whether its variations on the same question.
    Perhaps you could explain again and you may then get more than one reply to your question(s)
    Thanks
    Thanks, I am going to do some investigation and look into your links both of them further and see what kind of traction I get. I think is best to do DSN less linking because it helps with user on other machine.

  10. #10
    isladogs's Avatar
    isladogs is offline MVP / VIP
    Windows 10 Access 2010 32bit
    Join Date
    Jan 2014
    Location
    Somerset, UK
    Posts
    5,974
    For the past 15 years or so, I have only used DSN less connections to Access or SQL Server BEs as it saves a lot of work overall.
    Once you have set it up the first time its simple to use/maintain.
    However most developers stick with ODBC connections possibly because the initial setup needs more work/code
    Colin, Access MVP, Website, email
    The more I learn, the more I know I don't know. When I don't know, I keep quiet!
    If I don't know that I don't know, I don't know whether to answer

  11. #11
    johnseito is offline Competent Performer
    Windows 7 64bit Access 2010 64bit
    Join Date
    Aug 2013
    Posts
    419
    Quote Originally Posted by isladogs View Post
    For the past 15 years or so, I have only used DSN less connections to Access or SQL Server BEs as it saves a lot of work overall.
    Once you have set it up the first time its simple to use/maintain.
    However most developers stick with ODBC connections possibly because the initial setup needs more work/code
    Thanks for sharing the links and it’s great that you have 15 years, wish I could say the same. So I tried your first link and unfortunately it doesn’t connect to the sql server database.

    What should I put for local and remote table name ?

    I noticed if you put local table name it finds that table in Access and deletes it, not sure why it does that.

    My connection is trust connection.

    And I don’t know what is dbAttachSavePWD it came with a number, not sure where it came from.

    I get error message at currentdb.tabledefs.append td.

    Stated connection failed, sql server error: 772. Please advise ! Thx

  12. #12
    johnseito is offline Competent Performer
    Windows 7 64bit Access 2010 64bit
    Join Date
    Aug 2013
    Posts
    419
    What do you advise I use, CreateTableDef or DAO.RegisterDatabase method ? Thx

  13. #13
    isladogs's Avatar
    isladogs is offline MVP / VIP
    Windows 10 Access 2010 32bit
    Join Date
    Jan 2014
    Location
    Somerset, UK
    Posts
    5,974
    Hi
    Apologies but you're asking me questions that don't seem to fit the way I do things.
    My fault for not reading the links properly first.
    Which link are your questions referring to?
    Answering on my tablet so I cant supply any code at the moment.
    Apologies for a rather general answer which doesn't answer all your questions.
    My approach uses two local tables
    1. TblTableLnkTypes - this contains details of the connection strings for each link database - Access/SQL Server etc.
    This includes database name/path/password for Access files and server name/instance/password etc for SQL Server.
    Using this table allows me to connect the FE to one or more BE files. In one case, I have 7 different BEs though not all in use at once.
    2. TblTableLinks - this lists all linked table names and aliases together with the link database
    The table names are those in the linked database(s) - I don't use the dbo_ prefix
    The relinking code then removes all existing links (if any) then loops through each linked table in turn making new links based in the information stored in the first table to build the connection strings.
    I've not used trusted connections but the code works for those - the connection string is slightly different however.
    For a large database with around 350 linked tables, the relinking takes less than 30 seconds
    I can try to be more specific if needed when I have my code in front of me.
    I hope this is some use in the meantime
    Colin, Access MVP, Website, email
    The more I learn, the more I know I don't know. When I don't know, I keep quiet!
    If I don't know that I don't know, I don't know whether to answer

  14. #14
    johnseito is offline Competent Performer
    Windows 7 64bit Access 2010 64bit
    Join Date
    Aug 2013
    Posts
    419
    It definitely is useful. wow that is amazing, linked 350 tables in 30 seconds.

    http://www.accessmvp.com/DJSteele/DSNLessLinks.html.

    I was reviewing this link that you had provided. I was stuck in some areas of it. Some guidance and codes would be nice and appreciated.

  15. #15
    isladogs's Avatar
    isladogs is offline MVP / VIP
    Windows 10 Access 2010 32bit
    Join Date
    Jan 2014
    Location
    Somerset, UK
    Posts
    5,974
    Less than 30 seconds...!

    I'm busy most of today but will try & post some example code later or tomorrow
    It won't be a complete working example as what I have is part of large commercial apps but hopefully it will be more than enough to get you going

    If possible can be quote the part of Doug's article that you are stuck on. Do bear in mind that it was written around 2003 or so
    Colin, Access MVP, Website, email
    The more I learn, the more I know I don't know. When I don't know, I keep quiet!
    If I don't know that I don't know, I don't know whether to answer

Page 1 of 2 12 LastLast
Please reply to this thread with any new information or opinions.

Similar Threads

  1. Linking access to sql server express
    By lrz in forum Access
    Replies: 1
    Last Post: 11-24-2018, 02:51 AM
  2. Linking to SQL Server from Access
    By JoeM in forum SQL Server
    Replies: 15
    Last Post: 05-11-2015, 09:53 AM
  3. Replies: 5
    Last Post: 02-23-2014, 10:50 PM
  4. Replies: 2
    Last Post: 08-29-2013, 01:19 PM
  5. Linking access database to tables in sql server is enough?
    By masoud_sedighy in forum SQL Server
    Replies: 6
    Last Post: 01-31-2012, 07:59 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums