出于调试目的,我想知道快速测试 OLE DB 连接字符串的方法。
我找到了this free software ,在我的机器上可以运行,测试成功。
有没有更快的方法来做到这一点,也许是通过 Windows 上的命令行?因为大多数时候,是客户而不是我来完成这个任务,所以我更喜欢“零安装”的方法,这样对他们的系统影响最小。
最佳答案
以下方法已证明对我有用。它 super 快速且实用,并且不需要 PowerShell:
<小时/>
- Open up Notepad and create an empty text file, then click File -> click Save -> and save it with the File name: TestConnection.udl to your desktop.
- Go to your desktop and double-click on the TestConnection.udl file you just created and the Data Link Properties box will popup.
- Select the Provider tab and Find the provider that you want to connect with and click Next >>.
- Now from the Connection tab, select or enter your source/ server name -> then enter information to log on to server -> and select the database on the server.
- Click Test Connection and click OK to save the file. If errors occur during testing of your connection string, you will get a popup box with the error message.
演练(与上面相同,但带有图像)
打开记事本并创建一个空文本文件,然后单击文件 -> 单击保存 - 并将其以文件名:TestConnection.udl 保存到桌面:
转到桌面并双击刚刚创建的 TestConnection.udl 文件,将弹出“数据链接属性”框。
选择“提供商”选项卡,找到您想要连接的提供商,然后单击“下一步>>”。
现在,从“连接”选项卡中,选择或输入您的源/服务器名称 -> 然后输入登录服务器的信息 -> 并选择服务器上的数据库。
单击“测试连接”,然后单击“确定”保存文件。如果在测试连接字符串期间发生错误,您将看到一个包含错误消息的弹出框。
关于.net - 测试 OLE DB 连接字符串的快速方法,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3910364/