Page 2 of 2 FirstFirst 12
Results 16 to 21 of 21
  1. #16
    roberto21 is offline Advanced Beginner
    Windows 10 Access 2016
    Join Date
    Apr 2019
    Posts
    89

    Assuming that by "remote computer" you mean the one from which I am attempting the connection, of course I tested it. It is a system dsn: as I said, the connection verification works, the connection in the code doesn't. The same dsn in the server machine works fine.

  2. #17
    Join Date
    Jun 2010
    Location
    Belgium
    Posts
    1,180
    The only other thing I can think about is something is missing/wrong in the VBA code. As SQL dba I am not an expert in VBA coding, so maybe another programmer can help here.

  3. #18
    roberto21 is offline Advanced Beginner
    Windows 10 Access 2016
    Join Date
    Apr 2019
    Posts
    89
    By remote computer I assume you mean the one from which I atempt th connection. Of course, here the DSN is tested at the end of the cration: it work ok here, and fail in the code.
    Naive solution to the problem: since it consistently refuses to pass the userid, let's force it:

    cnn.open ("DSN=Driver18;UID=sa;PWD=xxxxx")

    this works.... I do not consider this a solution, only a bypass. I'd like an explanation of the reason why the dsn drops the userid. Or is it a bug?

  4. #19
    Join Date
    Jun 2010
    Location
    Belgium
    Posts
    1,180
    Could be VBA doesn't work well with DSN files

  5. #20
    roberto21 is offline Advanced Beginner
    Windows 10 Access 2016
    Join Date
    Apr 2019
    Posts
    89
    OK, I think we can close this discussion. It was my fault, I did not search enough. Simply stated, the password you supply in the dsn definition is only used to check the connection at the end, but is not saved in the file for security reasons. The explanation is found here

    https://learn.microsoft.com/en-us/sq...l-server-ver16

    The key sentence is

    This field only applies to the connection made to determine the server default settings; it doesn't apply to subsequent connections made using the new data source.

    Of course, the error in the log is completely misleading, but this is another matter.
    Thank you all for your interest and help.

  6. #21
    Join Date
    Jun 2010
    Location
    Belgium
    Posts
    1,180
    thx for sharing the insight and solution

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

Similar Threads

  1. Replies: 1
    Last Post: 06-25-2018, 04:15 PM
  2. Replies: 2
    Last Post: 06-20-2018, 11:29 AM
  3. Dsn or dsn less which one i have to use
    By masoud_sedighy in forum SQL Server
    Replies: 5
    Last Post: 09-16-2017, 05:13 PM
  4. User DSN vs System DSN
    By Paul H in forum SQL Server
    Replies: 5
    Last Post: 08-23-2016, 11:56 AM
  5. Replies: 1
    Last Post: 07-15-2013, 08:34 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