ASP应用程序中的连接字符串 [英] connection string in asp application

查看:115
本文介绍了ASP应用程序中的连接字符串的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在开发一个asp应用程序,因为我正在使用global.asa来连接数据库,这里是连接字符串的代码.
Application("Conn_TestGovbergConnectionString") = "Provider=SQLOLEDB.1;Data Source=VCNSQL88.webhost4life.com,1433;User Id=test;PASSWORD=test;Initial Catalog=test;"

我在index.asp中这样称呼它.

I am developing an asp application, in that I am using global.asa for connecting to database here is the code for connection string.
Application("Conn_TestGovbergConnectionString") = "Provider=SQLOLEDB.1;Data Source=VCNSQL88.webhost4life.com,1433;User Id=test;PASSWORD=test;Initial Catalog=test;"

and I am calling it in index.asp like this.

Dim objConn
Set objConn=Server.CreateObject("ADODB.Connection")
objConn.Mode = 3
objConn.cursorlocation = 3
objConn.Open (Application("Conn_TestGovbergConnectionString"))


它给出了这样的错误.


It is giving error like this.

Microsoft OLE DB Provider for ODBC Drivers error '80004005'
[Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified
/staging1/index.asp, line 9


有人可以帮我解决这个问题吗?


Can anyone help me to solve this?

推荐答案

好像您正在使用ODBC,但尚未在控制面板中定义ODBC数据源.打开控制面板,选择设置数据源(ODBC)"并定义一个新的DSN.之后,在连接字符串中使用该DSN名称作为您的数据源.
Looks like you''re using ODBC but you haven''t defined a ODBC data source in control panel. Open Control Panel, choose "Set up data sources (ODBC)" and define a new DSN. After that use that DSN name as your data source in the connection string.


这篇关于ASP应用程序中的连接字符串的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆