如何从Web应用程序修复与DB2的断开连接?

时间:2022-05-31 09:11:49

I support some old web applications, VBScript-based ASP for the UI and VB6 COM modules for the business and data access layers. Last weekend, I installed DB2 Connect Enterprise Edition v8 fixpack 14 on several Windows 2000 servers, and one of the web apps errors out on null data when it calls the built in VBScript function FormatNumber. This numeric data is retrieved by a SQL Server query, but the only way the SQL Server column is populated is with the calculated results returned from a DB2 query earlier in a progression through several pages.

我支持一些旧的Web应用程序,用于UI的基于VBScript的ASP和用于业务和数据访问层的VB6 COM模块。上周末,我在几台Windows 2000服务器上安装了DB2 Connect Enterprise Edition v8 fixpack 14,当调用内置的VBScript函数FormatNumber时,其中一个web应用程序错误地出现在null数据上。此数字数据由SQL Server查询检索,但填充SQL Server列的唯一方法是使用从早期的DB2查询返回的计算结果通过多个页面。

When I installed DB2 Connect EE, one of the components loaded was MDAC 2.7. I followed corporate instructions and had the installation save an ODBC System Data Source, which reported a good connection when I tested it after the install.

当我安装DB2 Connect EE时,加载的其中一个组件是MDAC 2.7。我遵循公司指示并安装了一个ODBC系统数据源,它在安装后测试时报告了良好的连接。

For what it's worth, the project references in the production VB6 modules pointed to MDAC 2.5. I have tried recompiling and deploying to COM on my test server new versions of the VB6 modules referencing MDAC 2.7. My development environment is Windows XP Pro, with MDAC 2.8 and DB2 Connect EE v9.5 installed. When I deployed the updated VB6 dlls, the CreateObject fails to instantiate the classes with the error message that "The class does not support automation or the requested interface".

对于它的价值,生产VB6模块中的项目引用指向MDAC 2.5。我尝试在我的测试服务器上重新编译和部署到COM,引用MDAC 2.7的VB6模块的新版本。我的开发环境是Windows XP Pro,安装了MDAC 2.8和DB2 Connect EE v9.5。当我部署更新的VB6 dll时,CreateObject无法使用“该类不支持自动化或所请求的接口”的错误消息来实例化类。

I've rolled the DB2 Connect install back and have reinstall v8 of the DB2 runtime client, which was the previous environment. The problem, however, persists.

我已经回滚了DB2 Connect安装并重新安装了DB2运行时客户端的v8,这是以前的环境。然而,问题仍然存在。

1 个解决方案

#1


I don't really get the picture for how things are connected together - where is the SQL Server and where is the DB2.
There are forums on IBM's site for helping out specifically with DB2 Connect EE, wwhich I think is a pretty pricey product (not sure tho).

我并没有真正了解事物如何连接在一起 - SQL Server在哪里以及DB2在哪里。 IBM的网站上有专门讨论DB2 Connect EE的论坛,我认为这是一个非常昂贵的产品(不确定)。

One way I have seen people do it is configure a SQL server as the data gateway. You can define DB2 as a linked server, and then perform SQL queries through the SQL server in order to get to DB2. Apps need only to be able to connect to SQL Server, not directly to DB2. They get to DB2 indirectly. Depending on the load on the system this may or may not be feasible for you. You can even do joins across data stored separately in DB2 and SQL with this approach.

我见过人们这样做的一种方法是将SQL服务器配置为数据网关。您可以将DB2定义为链接服务器,然后通过SQL服务器执行SQL查询以获取DB2。应用程序只需要能够连接到SQL Server,而不是直接连接到DB2。他们间接地访问DB2。根据系统的负载,这对您来说可能是可行的,也可能是不可行的。您甚至可以使用此方法跨DB2和SQL中单独存储的数据进行连接。

It's one more option in the toolbox, along with replication, data federation, and so on. I found that it reduces the variability in connectivity.

它是工具箱中的另一个选项,还有复制,数据联合等。我发现它减少了连接的可变性。

#1


I don't really get the picture for how things are connected together - where is the SQL Server and where is the DB2.
There are forums on IBM's site for helping out specifically with DB2 Connect EE, wwhich I think is a pretty pricey product (not sure tho).

我并没有真正了解事物如何连接在一起 - SQL Server在哪里以及DB2在哪里。 IBM的网站上有专门讨论DB2 Connect EE的论坛,我认为这是一个非常昂贵的产品(不确定)。

One way I have seen people do it is configure a SQL server as the data gateway. You can define DB2 as a linked server, and then perform SQL queries through the SQL server in order to get to DB2. Apps need only to be able to connect to SQL Server, not directly to DB2. They get to DB2 indirectly. Depending on the load on the system this may or may not be feasible for you. You can even do joins across data stored separately in DB2 and SQL with this approach.

我见过人们这样做的一种方法是将SQL服务器配置为数据网关。您可以将DB2定义为链接服务器,然后通过SQL服务器执行SQL查询以获取DB2。应用程序只需要能够连接到SQL Server,而不是直接连接到DB2。他们间接地访问DB2。根据系统的负载,这对您来说可能是可行的,也可能是不可行的。您甚至可以使用此方法跨DB2和SQL中单独存储的数据进行连接。

It's one more option in the toolbox, along with replication, data federation, and so on. I found that it reduces the variability in connectivity.

它是工具箱中的另一个选项,还有复制,数据联合等。我发现它减少了连接的可变性。