简体   繁体   English

ASP经典SQL Server 2005无法连接

[英]asp classic sql server 2005 can't connect

I am trying to connect to a 2005 sql server and pull information from it on asp classic. 我正在尝试连接到2005 sql服务器,并在asp classic上从中获取信息。 I already made a java application and i was able to pull information from it using these variables. 我已经制作了一个Java应用程序,并且能够使用这些变量从中获取信息。

//SQL Server Values
String userName = "sa";
String password = "Passw0rd";
String url = "jdbc:sqlserver://DLI9200;instanceName=SQLExpress;databaseName=DLIDEV";

and this is my class 这是我的课

Class.forName("com.microsoft.sqlserver.jdbc.SQLServerDriver");

I can connect fine with this i am also using the authorization.dll and the sqljdbc4.jar for my java portion of the project. 我可以与此很好地连接,我也正在使用我的项目Java部分的authorization.dll和sqljdbc4.jar。

For my asp-classic side i am using this as my connection string. 对于我的asp-classic方面,我将其用作我的连接字符串。

<%
ConnString ="Provider=SQLOLEDB; Data Source=DLI9200\SQLEXPRESS; Database=DLIDEV; User Id=sa; Password=Passw0rd;"
%>

I thought this would work but it doesn't seem to be loading anything.I put the pages on tomcat and the pages goes load just nothing is showing up at all on IE. 我以为这可以用,但似乎没有加载任何东西。我将页面放在Tomcat上,页面被加载后,IE上根本没有显示任何内容。 But I am not getting any error from any of the pages, also in case it helps the sql server and the asp pages are on the same machine. 但是我没有从任何页面上得到任何错误,即使在它帮助sql server和asp页面位于同一台机器上的情况下也是如此。 Any help or advice would be greatly helped and appreciated. 任何帮助或建议将大大帮助和赞赏。

Edit - You can't run classic ASP on Tomcat, you need IIS (or IIS Express). 编辑-您无法在Tomcat上运行经典的ASP,需要IIS(或IIS Express)。 Maybe Tomcat is serving your pages as if they are flat HTML, but it won't do anything with the server side code. 也许Tomcat就像页面是纯HTML一样为您提供服务,但是它不会对服务器端代码执行任何操作。

Your conn string looks fine, but here are two things to try. 您的conn字符串看起来不错,但是可以尝试两种方法。

First, replace SQLOLEDB with SQLNCLI. 首先,将SQLOLEDB替换为SQLNCLI。 (SQLNCLI10 if you're using MSSQL 2008, or SQLNCLI11 if MSSQL 2012) (如果使用的是MSSQL 2008,则为SQLNCLI10;如果使用的是MSSQL 2012,则为SQLNCLI11)

Second - if you want to stick with SQLOLEDB, try using Initial Catalog=DLIDEV (instead of Database=DLIDEV ) 其次-如果您想坚持使用SQLOLEDB,请尝试使用Initial Catalog=DLIDEV (而不是Database=DLIDEV

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM