简体   繁体   中英

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. I already made a java application and i was able to pull information from it using these variables.

//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.

For my asp-classic side i am using this as my connection string.

<%
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. 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. 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). Maybe Tomcat is serving your pages as if they are flat HTML, but it won't do anything with the server side code.

Your conn string looks fine, but here are two things to try.

First, replace SQLOLEDB with SQLNCLI. (SQLNCLI10 if you're using MSSQL 2008, or SQLNCLI11 if MSSQL 2012)

Second - if you want to stick with SQLOLEDB, try using Initial Catalog=DLIDEV (instead of Database=DLIDEV )

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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