0
votes

I failed to connect using this connection string

strConnString = "Provider=SQLOLEDB;Initial Catalog=fsw;SERVER=HARDIXP\hardi;Integrated Security=SSPI;"

Microsoft OLE DB Provider for ODBC Drivers (0x80004005) [Microsoft][ODBC SQL Server Driver][DBMSLPCN]SQL Server does not exist or access denied.

I can connect fine using SQL Server Management Studio. On the "Connect to Server" dialog, I have

Server Name: HARDIXP Authentication: Windows Authentication

After it is connected, the server looks like this

HARDIXP (SQL Server 10.0.2531 - HARDIXP\hardi)

If I don't specify the server name, the error will be

Microsoft OLE DB Provider for SQL Server (0x80040E4D) Login failed for user 'HARDIXP\IUSR_GEOFFREYXP'.

Note that it is trying a different user, probably because the database was first set up for Geoffrey, not Hardi.

How can I connect to my local SQL Server from this Classic ASP code?

EDIT: I am on Windows XP, IIS 5.1

1

1 Answers

0
votes

Assuming this is running on windows.

The ASP process needs to be running as a windows authenticated user that has access to the database. Just set the application pool on the website to have this identity's credentials.