Results 1 to 4 of 4
  1. #1
    martingaleh is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Sep 2015
    Posts
    22

    Connection String to Postgre

    I'm using Access 2010 64 bit
    I need help in the connection string to my database. First I did this
    Code:
    Dim connector As ADODB.Connection
        Dim rst As ADODB.Recordset
        
        Set connector = New ADODB.Connection
        connector.Open CurrentDb.TableDefs("MyInternetTable").Connect
    But what's good for the table isn't good for VBA and I got datasource name not found even though the linked table found it

    Then I tried this:
    Code:
    "ODBC;DRIVER={PostgreSQL35W} etc"
    Because of this:
    Click image for larger version. 

Name:	cs.jpg 
Views:	10 
Size:	33.9 KB 
ID:	24299
    Which of course didn't work even though that thing is on every tab of the data source. Then I tried this:
    Click image for larger version. 

Name:	cs2.jpg 
Views:	10 
Size:	35.5 KB 
ID:	24300


    and did this:
    Code:
    connector.Open "ODBC;DSN={PostGre};
    But, I just don't get these connection strings. I dont' know what features are enabled by making these connection strings so difficult to work. I'd appreciate any help available. Thanks

  2. #2
    ssanfu is offline Master of Nothing
    Windows XP Access 2010 32bit
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    There is a site about connection strings:
    The Connection Strings Reference
    http://www.connectionstrings.com/

    Specific to postgresql: http://www.connectionstrings.com/postgresql/


    Have fun reading...

  3. #3
    martingaleh is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Sep 2015
    Posts
    22
    Oh yeah, and http://www.connectionstrings.com/postgresql/
    Doesn't work. Still have the same error. This is what I used out of that site:
    connector.Open "Driver={PostgreSQL UNICODE};Server= etc.

  4. #4
    martingaleh is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Sep 2015
    Posts
    22
    I tried to make a passthrough Query to steal its connection string. The Pass through query works and I'm able to send a command to my server. Then I stole the connection string like so:
    Click image for larger version. 

Name:	cs3.jpg 
Views:	9 
Size:	53.1 KB 
ID:	24301
    And put it into my code:
    Code:
    Dim connector As ADODB.Connection
        Dim rst As ADODB.Recordset
        
        Set connector = New ADODB.Connection
        connector.Open "ODBC;DSN=PostgreSQL35W;DATABASE=ama
    But lo and behold, still doesnt' work because the datasource name not found even though the linked table found it. I don't know what the right solution is, but if the measures I've taken still dont' work, this access program is not a very good one to bet your career on.

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. Connection string error
    By Philosophaie in forum Access
    Replies: 3
    Last Post: 09-08-2015, 10:26 PM
  3. Replies: 2
    Last Post: 11-22-2013, 09:32 AM
  4. Connect System DSN using connection string
    By jbailey4545 in forum Access
    Replies: 0
    Last Post: 11-08-2013, 01:29 PM
  5. Connection String
    By cradaa in forum Access
    Replies: 4
    Last Post: 05-24-2011, 07:28 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