oledbConnection to SQL Server

R

Roger Withnell

I have built websites in Classic ASP and am now building my first one in
ASP.NET.

In Classic ASP, I connect to my SQL Server database with:

Set ObjConn = Server.Createobject("ADODB.Connection")
strConnection = "DSN=db1; database=db2;UID=xxx;PWD=yyy;"
objConn.Open strConnection

What is the connection string in asp.net?
OleDbConnection("?")

Any help much appreciated.

Roger
 
R

Roger Withnell

I can now connect to the database on my operational server, which uses SQL
Server authentication, with:

'dbconn=New OleDbConnection("Provider=sqloledb; Data Source=ip address;
Initial Catalog=dbName; User Id=xxxx; Password=yyyy;")

But I cannot connect to my in house SQL Server on localhost, which uses
Windows Authentication. The string:

dbconn=New OleDbConnection("Provider=sqloledb; Data
Source=UBE-IAS\SQLEXPRESS; Initial Catalog=upperbridge2; User Id=;
Password=;")

gives the error Invalid authorization specification.

What is the correct connection string for this?

Thanking you in anticipation.

Roger
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top