I am running SQLServerExpress on my desktop PC having IIS on Windows XP SP3.
I want to login to the SQL server through the ASP pages and access the
database for displaying the results on ASP pages.
I tried creating the connection string using the UDL editor with
1.) Use Windows NT Integrated Security:
The connection string as designed by the UDL editor is as below:
[oledb]
; Everything after this line is an OLE DB initstring
Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security
Info=False;Initial Catalog=adminSQLServerDatabase;Data
Source=127.0.0.1\SQLEXPRESS
The Test Connection from within the UDL editor gives message of success for
the above connection string.
However, when we copy the above connection string inside an ASP page, the
connection fails giving an error message.
2. ) When we use the option of "USE a specific user name and password"
inside the UDL editor, then we get error message- "Test connection failed
because of an error in initialising provider. Login failed for user 'sa'."
The error message continues even if we use the default internet guest user
account for the UDL editor.
Further, if we use the connection string string of this scenario, the
connection fails in the ASP page.
Please advise on how to connect to the database from inside the ASP pages
using suitable connection string. Also advise if OLEDB is the way to go?
>> Stay informed about: How to Login to SQL server in ASP pages?