ADODB 连接问题

发布于 2024-08-07 21:40:57 字数 667 浏览 3 评论 0 原文

我正在尝试从 VB 6.0 应用程序(连接到 SQL 2000)执行数据库操作。该应用程序在我的本地和测试机器上运行良好,但在 UAT 环境中出现以下错误。

dbConn - Nothing
lErrorNum = -2147024770
sErrorDesc = Method '~' of object '~' failed

我的源代码是:

Dim connectionString As String
connectionString = "DSN = {My DSN Name}"
Private dbConn As ADODB.Connection
Set dbConn = New ADODB.Connection
With dbConn
    .ConnectionString = sConn
    .ConnectionTimeout = 10             
    .CursorLocation = adUseClient       
    .CommandTimeout = 60
    .Open
End With

MDAC版本是MDAC 2.8 SP2 ON WINDOWS SERVER 2003 SP1。 (用CompChecker检查)

我已经将源代码复制到UAT环境并尝试从IDE运行它,但仍然是相同的错误。

I am trying to perform a database operation from a VB 6.0 application (connecting to SQL 2000). The application is running fine in my local and test machines, but it gives the following error in the UAT environment.

dbConn - Nothing
lErrorNum = -2147024770
sErrorDesc = Method '~' of object '~' failed

My source code is:

Dim connectionString As String
connectionString = "DSN = {My DSN Name}"
Private dbConn As ADODB.Connection
Set dbConn = New ADODB.Connection
With dbConn
    .ConnectionString = sConn
    .ConnectionTimeout = 10             
    .CursorLocation = adUseClient       
    .CommandTimeout = 60
    .Open
End With

The MDAC version is MDAC 2.8 SP2 ON WINDOWS SERVER 2003 SP1. (Check with CompChecker)

I have copied the source code to the UAT environment and tried running it from the IDE, but still the same error.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

莳間冲淡了誓言ζ 2024-08-14 21:40:57

一种可能性是您需要在 UAT 服务器上安装 MS SQL 客户端工具 (http://msdn.microsoft.com/en-us/library/aa197918(SQL.80).aspx)。您是否使用测试连接选项检查了 DSN 本身?您还可以尝试无 DSN 连接字符串

One possibility is that you need to install the MS SQL Client tools on the UAT server (http://msdn.microsoft.com/en-us/library/aa197918(SQL.80).aspx). Have you checked the DSN itself using the test connection option? You could also try an DSN-less connection string.

始于初秋 2024-08-14 21:40:57

错误代码是 Win32 设施错误,123 ERROR_INVALID_NAME:文件、目录名或卷标语法不正确。

听起来 ADO 没有正确安装。

The error code is a Win32 facility error, 123 ERROR_INVALID_NAME: The file, directory name, or volume label syntax is incorrect.

Sounds like ADO isn't installed correctly.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文