0
votes

I have been unsuccessful connecting to SQL server 2005 Express database from a Classic ASP site. In an attempt to locate error, I created an ASP.NET application and was able to connect and pull data using the same connection string without issue.

Dim mConnection

Set mConnection = Server.CreateObject ("ADODB.Connection")

mConnection.Open "Server=server;Database=database;UID=username;PWD=password"

PS. ASP site currently works on original system, so build and data is good (this is for new system).

Any suggestions?

3
What error message will occur? - Reporter
States that resources I am attempting to use are not available. - Thomas

3 Answers

1
votes

You are not specifying the provider or driver:

Try:

Provider=SQLNCLI;Server=.\SQLEXPRESS;Database=myDataBase;Uid=myUsername;Pwd=myPassword;

You would use .\SQLEXPRESS if the database is local or SERVERNAMEORIPADDRESS\SQLEXPRESS

0
votes

First suggestion would be not to be writing a new site in classic ASP. I believe that the object model may be different under classic ASP, and you may not have the right connection string for the model you are building under.

Where do you get an error, and what error do you get?

0
votes

Follow this example: http://www.cruto.com/resources/vbscript/vbscript-examples/misc/database/connect-to-a-sql-server-database.asp

PS: Sorry for the unformated text because I wrote this answer with ff 2.0 and Windows 98 as operatingsystem.