How does an OLEDB/ODBC connection know the path to a SQL Server database by name only?

BarrettNashville

If i have a connection string like this that I use in a Data Connection in Excel to get data from a SQL Server database:

OLEDB;
Provider=SQLOLEDB.1;
User ID=MY_USERNAME;
Password=MY_PASSWORD;
Persist Security Info=False;
Initial Catalog=ABC;
Data Source=MY_SQL_SERVER_NAME;
Use Procedure for Prepare=1;
Auto Translate=True;
Packet Size=4096;
Use Encryption for Data=False;
Tag with column collation when possible=False

How does my computer know the path to MY_SQL_SERVER_NAME on the network?

I assume that is somehow set by my company using some sort of configuration file somewhere, but I don't really know how it all works under the hood.

If I were getting data from a website instead of a SQL Server database, the website resource would need to be preceded by a path/domain-name like this: http:\\www.example.com\MY_RESOURCE_NAME.html

Without that path, I couldn't get to MY_RESOURCE_NAME.html. So, then how does ODBC work without a path preceding MY_SQL_SERVER_NAME?

My problem is that most of the time this connection string works fine. However, if I'm at home on VPN it doesn't. But I don't have any idea how to troubleshoot it.

Notes: I don't have a connection set up to MY_SQL_SERVER_NAME in the Windows ODBC Data Source Administrator, so my computer is somehow accessing the SQL Server by only using the connection string AFAIK.

Frank Thomas

ODBC relies on host name resolution capabilities, so the Data Source argument needs to be an expression that the host can lookup, via its available mechanisms. In Windows this involves resolution via SMB/CIFS, WINS, HostFile, DNS, mDNS, etc.

The VPN underscores that you are using SMB or DNS naming (with a short name, not FQDN), as both of those generally require fully qualified DNS names when configured on systems that do not permanently reside on the network in question. For instance, your host likely points to a LAN dns server, which doesn't host a zone for the network on the other side of the VPN. in those cases you must use a fully qualified domain name so that the query is resolved on the correct server.

この記事はインターネットから収集されたものであり、転載の際にはソースを示してください。

侵害の場合は、連絡してください[email protected]

編集
0

コメントを追加

0

関連記事

分類Dev

How to search a column name in all tables in a database in SQL Server 2012?

分類Dev

Show only one database on SQL Server

分類Dev

Correct connection string MS sql server database 2008

分類Dev

SQL Server Profiler - How to filter trace to only display events from one database?

分類Dev

How to setup SSRS with an Azure SQL Server Database

分類Dev

How to import huge blob into SQL Server database?

分類Dev

Trying to change connection host name in perl script that connect to SQL Server DB

分類Dev

How to fix "Error: Path "/__path__/__name@dasherize@if-flat" does not exist" in Angular

分類Dev

How does HttpContext.Current.User.Identity.Name know which usernames exist?

分類Dev

SQL Server - FOR XML PATH : how to add xmlns:xsd to the root element?

分類Dev

jdbc: Could not create connection to database server

分類Dev

Correct Connection string for accessing remote database server

分類Dev

Name of buffer to only filename instead of path

分類Dev

How to check is connection to database opened?

分類Dev

How do I see inside of a SQL Server database file

分類Dev

How can I change properties of FK in SQL Server database project?

分類Dev

How to add date in SQL Server database in correct way?

分類Dev

How to store Excel sheet data in SQL Server database

分類Dev

SQL Server How to SELECT a column only if it exists in the table

分類Dev

How to retrieve only particular part of string in SQL Server 2012

分類Dev

Remove or replace the absolute path of an EAssertionFailed with a relative path or the file name only?

分類Dev

C# connection to SQL database error

分類Dev

entity framework database issue - A network-related or instance-specific error occurred while establishing a connection to SQL Server

分類Dev

How to connect to Azure Oracle 12c Database using sqlplus or sql developer cloud connection

分類Dev

How can I exclude controller name from the virtual path when I use Server.MapPath()?

分類Dev

How to pass the path name to sed

分類Dev

How to know a Database needs compact and repair?

分類Dev

Changing default database in RODBC for sql server database

分類Dev

Searching an SQL Server database with Substring

Related 関連記事

  1. 1

    How to search a column name in all tables in a database in SQL Server 2012?

  2. 2

    Show only one database on SQL Server

  3. 3

    Correct connection string MS sql server database 2008

  4. 4

    SQL Server Profiler - How to filter trace to only display events from one database?

  5. 5

    How to setup SSRS with an Azure SQL Server Database

  6. 6

    How to import huge blob into SQL Server database?

  7. 7

    Trying to change connection host name in perl script that connect to SQL Server DB

  8. 8

    How to fix "Error: Path "/__path__/__name@dasherize@if-flat" does not exist" in Angular

  9. 9

    How does HttpContext.Current.User.Identity.Name know which usernames exist?

  10. 10

    SQL Server - FOR XML PATH : how to add xmlns:xsd to the root element?

  11. 11

    jdbc: Could not create connection to database server

  12. 12

    Correct Connection string for accessing remote database server

  13. 13

    Name of buffer to only filename instead of path

  14. 14

    How to check is connection to database opened?

  15. 15

    How do I see inside of a SQL Server database file

  16. 16

    How can I change properties of FK in SQL Server database project?

  17. 17

    How to add date in SQL Server database in correct way?

  18. 18

    How to store Excel sheet data in SQL Server database

  19. 19

    SQL Server How to SELECT a column only if it exists in the table

  20. 20

    How to retrieve only particular part of string in SQL Server 2012

  21. 21

    Remove or replace the absolute path of an EAssertionFailed with a relative path or the file name only?

  22. 22

    C# connection to SQL database error

  23. 23

    entity framework database issue - A network-related or instance-specific error occurred while establishing a connection to SQL Server

  24. 24

    How to connect to Azure Oracle 12c Database using sqlplus or sql developer cloud connection

  25. 25

    How can I exclude controller name from the virtual path when I use Server.MapPath()?

  26. 26

    How to pass the path name to sed

  27. 27

    How to know a Database needs compact and repair?

  28. 28

    Changing default database in RODBC for sql server database

  29. 29

    Searching an SQL Server database with Substring

ホットタグ

アーカイブ