简体   繁体   English

查询多个DSN(域名源)

[英]Query regarding multiple DSN (domain source name)

I'm new to ODBC and DSN's in general. 我是ODBC和DSN的新手。

We have a product A that accesses a database "T" via a DSN D1 that has already been defined. 我们有一个产品A,它通过已定义的DSN D1访问数据库“ T”。

I'm now writing a test app testA that exercises various functionalities of product A and also needs to validate various database entries made by A. 我现在正在编写一个测试应用程序testA,它可以行使产品A的各种功能,并且还需要验证A所做的各种数据库条目。

For this, I am trying to access the same DSN D1 (that was setup for database T) to read from db and do the necessary validations. 为此,我试图访问相同的DSN D1(已为数据库T设置)以从db读取数据并进行必要的验证。

I'm however having issues with that. 但是,我对此有疑问。 I've setup the dsn, but when I do a SQLConnect with this dsn, I get a return value of -1.(I dont see any corresponding values for this return type either)n 我已经设置了dsn,但是当我使用此dsn执行SQLConnect时,返回值为-1。(我也看不到该返回类型的任何对应值)

Any clues on what this means and if I'm doing something wrong.Can we have 2 different processes or apps connect to the same DSN? 关于这意味着什么的任何线索,如果我做错了。我们可以将2个不同的进程或应用程序连接到同一个DSN吗?

You can test access using a "udl" file. 您可以使用“ udl”文件测试访问权限。 These files are largly misunderstood IMHO. 这些文件被误解了恕我直言。 They are simply a script that is used to launch the (db) connection library. 它们只是用于启动(db)连接库的脚本。 You can create them by creating an empty file in notepad and changing the extension to .udl from .txt. 您可以通过在记事本中创建一个空文件并将扩展名从.txt更改为.udl来创建它们。 You then double click on the file and configuer access to your database. 然后,您可以双击文件并配置对数据库的访问。 (they launch a build in configeration applet). (它们在配置小程序中启动构建)。 In my experience if a .udl file connects then any application will connect or 100% there is a problem with the application. 以我的经验,如果连接一个.udl文件,则任何应用程序都将连接,或者100%出现该应用程序有问题。 If the udl file will not connect, then 100% there is a firewall or something probibiting access to the account being used to try to connect. 如果udl文件无法连接,则说明存在100%的防火墙或其他可能导致尝试连接帐户的访问。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM