Results 1 to 3 of 3
  1. #1
    SteveFowkes is offline Novice
    Windows 7 64bit Access 2003
    Join Date
    Dec 2015
    Posts
    1

    COnnection string to query an access table linked to a SQL DB


    Hi wonder if anyone can help please...........

    I need to specify a COnnection string to query an access table linked to a SQL DB(which is on another server)

    I have tried something like below, but get an error

    ConnectionSQL.Open "ODBC;DRIVER=SQL Server;SERVER=x;WSID=xxxx;DATABASE=xxxxx;Network=x xxx;UID=xxxxx;PWD=xxxxxx"

    Any help gratefully received !

  2. #2
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,525
    cant you just LINK in the table, instead of a connection string?

  3. #3
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows 8 Access 2013
    Join Date
    Aug 2013
    Posts
    7,862
    I use DAO and the QueryDef object. Here is one example.

    Code:
        Dim db As DAO.Database
        Dim qdf As DAO.QueryDef
         
            Set db = CurrentDb
            Set qdf = db.QueryDefs("TestQueryName")
    '        Set qdf = db.CreateQueryDef("TestQueryName")
            
            qdf.Connect = "My Connection String"

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Remote Desktop Connection Broker connection string
    By Philosophaie in forum Access
    Replies: 1
    Last Post: 09-14-2015, 03:51 PM
  2. Linked Table ODBC connection
    By Tim@Syosset in forum SQL Server
    Replies: 5
    Last Post: 01-09-2015, 02:27 PM
  3. Specifiying a connection string in ms access forms
    By thebionicredneck2003 in forum Access
    Replies: 4
    Last Post: 05-09-2013, 04:19 PM
  4. Replies: 0
    Last Post: 03-08-2012, 03:12 AM
  5. Create dynamic connection string to Access
    By janwane in forum Access
    Replies: 2
    Last Post: 10-07-2011, 06:56 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