简体   繁体   English

ASP,DSN-Less连接,连接字符串语法给出未找到数据源名称的错误

[英]ASP, DSN-Less connection, connection string syntax gives Data source name not found error

This is the error message 这是错误消息

Microsoft OLE DB Provider for ODBC Drivers error '80004005' Microsoft OLE DB提供程序的ODBC驱动程序错误'80004005'

[Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified [Microsoft] [ODBC驱动程序管理器]找不到数据源名称,未指定默认驱动程序

/Ute/ute_class.inc, line 1357 /Ute/ute_class.inc,第1357行

This is my Ute.ASP code 这是我的Ute.ASP代码

Dim sDSN
sDSN = "Data Source=MYSERV0000\PSAPP01; Initial Catalog=LibraryDB; User Id=admsa; password=sa"

PS: I am able to use the same string within my web.config, with .net 4.0 PS:在.net 4.0中,我可以在web.config中使用相同的字符串

Side comment ... don't use .inc files. 旁注...请勿使用.inc文件。 Very bad practice ... if you have an error on the page it may provide the name of your .inc that has your database connection. 不好的做法...如果页面上有错误,它可能会提供具有数据库连接的.inc名称。 Since the .inc page is not an .asp, if someone types in the URL for that .inc it will just come back as plain text. 由于.inc页面不是.asp,因此,如果有人输入该.inc的URL,它将以纯文本形式返回。 WHAM ... visitor now has your connection string. WHAM ...访客现在有了您的连接字符串。 Convert it to an .asp and your problems are over. 将其转换为.asp,问题就解决了。

As far as the Connection String, there's too many possibilities to answer precisely so I'll just point you in the direction of http://connectionstrings.com/ Follow the right links and it should give you a template of what your connection string should be. 至于连接字符串,有太多的可能性可以精确地回答,所以我只为您指出http://connectionstrings.com/的方向。按照正确的链接进行操作,它应该为您提供连接字符串的模板是。

sDSN = "Provider=SQLNCLI;Server=SERVER\\INSTANCE;Database=exampleDB;Uid=admsa; Pwd=sa;" makes it work 使它起作用

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

相关问题 DSN-Less连接多个表 - DSN-Less Connection with multiple tables ASP Classic,SQL 2008,XML输出以及DSN与DSN-Less产生中文字母 - ASP Classic, SQL 2008, XML Output, and DSN vs DSN-Less Produces Chinese Letters 连接到现有DSN时出现异常“找不到数据源名称” - Exception “Data source name not found” while connecting to an existing DSN 通过dsn错误进行ODBC连接 - ODBC connection through dsn error 在连接字符串中包含服务名称的语法是什么? - What Is the Syntax for Including the Service Name in a Connection String? MS ACCESS jdbc.odbc连接。 找不到数据源名称/未指定默认驱动程序? - MS ACCESS jdbc.odbc connection. data source name not found/No default driver specified? RSConfig生成Dsn连接字符串不起作用 - RSConfig generates a Dsn Connection String doesn't work 错误:在所选数据源(asp.net c#,sql)上找不到名称为“ ProductID”的字段或属性 - Error: A field or property with the name 'ProductID' was not found on the selected data source (asp.net c#, sql) Ms Access创建DSN Less SQL连接时,如何指定Schema? - When Creating a DSN Less SQL Connection in Ms Access, How do I specify the Schema? ASP连接字符串 - ASP Connection String
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM