Results 1 to 11 of 11
  1. #1
    shaunsizen is offline Novice
    Windows 10 Office 365
    Join Date
    Mar 2024
    Posts
    5

    Odd ODBC Issue

    Hi
    Got a brain teaser here, just upgrading a client app to use TLS so ODBC v18 driver, the code drops and relinks the DB from the client to SQL Server. Connection string works fine when its the base code but fails when I compile it!!



    Any ideas?

    This is my string (I will be taking TrustServerCertificate=True out for prod but wanted to make sure its not that)

    strConnect = "ODBC;DRIVER=ODBC Driver 18 for SQL Server;Server=" & strServerName & ";UID=SAC_User;PWD=sac;DATABASE=" & strDatabase & ";Network=DBMSSOCN;PORT=1499"

    strConnect = strConnect & ";iTrustServerCertificate=True;Trusted_Connection= Yes;Encrypt=True"

    Any ideas? I am running 365 on 64Bit

  2. #2
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,525
    have you tried the generic drivers:
    SQL Server
    or
    SQL Client

    these always seem to work.

  3. #3
    shaunsizen is offline Novice
    Windows 10 Office 365
    Join Date
    Mar 2024
    Posts
    5
    Quote Originally Posted by ranman256 View Post
    have you tried the generic drivers:
    SQL Server
    or
    SQL Client

    these always seem to work.
    They do but are not encrypted and that's now what the client needs, it works uncompiled just fails when compiled?

  4. #4
    Micron is online now Virtually Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,801
    I use Option Explicit as a rule so this compiles for me
    Code:
    Sub Test()
    Dim strConnect As String, strServerName As String, strDatabase As String
    
    strConnect = "ODBC;DRIVER=ODBC Driver 18 for SQL Server;Server=" & strServerName & ";UID=SAC_User;PWD=sac;DATABASE=" & strDatabase & ";Network=DBMSSOCN;PORT=1499"
    strConnect = strConnect & ";iTrustServerCertificate=True;Trusted_Connection= Yes;Encrypt=True"
    
    End Sub
    What is the compile error message?
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

  5. #5
    isladogs's Avatar
    isladogs is offline MVP / VIP
    Windows 10 Office 365
    Join Date
    Jan 2014
    Location
    Somerset, UK
    Posts
    5,977
    Just out of interest, which version of Access are you using including build number, bitness and update channel.
    For example: Access 365 Monthly Enterprise Channel Version 2312 Build 16.0.17126.20190 64-bit

    I ask as there have been a number of ODBC related bugs recently not all of which have been fixed in certain channels
    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

  6. #6
    shaunsizen is offline Novice
    Windows 10 Office 365
    Join Date
    Mar 2024
    Posts
    5
    Hi,
    It compiles but just fails when you run the accde with a generic error, uncompiled is fine

    Running Microsoft® Access® for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20124) 64-bit with CurrentChannel updates and did a amanual update to be sure of latest version


  7. #7
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    Post 6 was moderated, I'm posting to trigger email notifications.

    Images can't be pasted into the reply window, they need to be attached in the "Go Advanced" area.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  8. #8
    shaunsizen is offline Novice
    Windows 10 Office 365
    Join Date
    Mar 2024
    Posts
    5
    Ah apologies for that

  9. #9
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    Quote Originally Posted by shaunsizen View Post
    Ah apologies for that
    No worries! Welcome to the site by the way.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  10. #10
    isladogs's Avatar
    isladogs is offline MVP / VIP
    Windows 10 Office 365
    Join Date
    Jan 2014
    Location
    Somerset, UK
    Posts
    5,977
    The ODBC bugs I was referring to are all fixed in Current Channel version 2402.
    See items 1,2 & 4 on Access Forever bugs, tools, events
    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
    shaunsizen is offline Novice
    Windows 10 Office 365
    Join Date
    Mar 2024
    Posts
    5
    Thanks I will take a look
    Shaun

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

Similar Threads

  1. ODBC issue resolved after relinking table
    By Globulous in forum Import/Export Data
    Replies: 0
    Last Post: 09-20-2022, 03:49 PM
  2. MailMerge to pdf ODBC driver 32/64 bit issue
    By apk19 in forum Import/Export Data
    Replies: 0
    Last Post: 06-22-2020, 08:24 PM
  3. ODBC link to Access - Permissions issue?
    By Evans2 in forum Access
    Replies: 0
    Last Post: 01-23-2015, 11:41 PM
  4. Access ODBC connection issue
    By cm-net in forum Access
    Replies: 1
    Last Post: 10-06-2014, 01:25 PM
  5. ODBC timestamp issue <<<< need help
    By BennyOng in forum Access
    Replies: 4
    Last Post: 08-04-2014, 07:26 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