Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Cannot connect to SQL Server database

Status
Not open for further replies.

TanyaSealey

Programmer
Jul 17, 2002
10
0
0
GB
I've created the following:

Dim objConn, objCommand, objQry

Set objConn = Server.CreateObject("ADODB.Connection")
Set objCommand = Server.CreateObject("ADODB.Command")

objConn.ConnectionString = "Provider=SQLOLEDB.1;Persist Security Info=False;Data Source=DATABASE;Integrated Security=SSPI;Initial Catalog=ProspectUs;OLE DB Services=-2"
objCommand.ActiveConnection = objConn

However the objCommand.ActiveConnect = objConn line fails every time. The current error message is 0x800A0E7D: Requested operation requires an OLE DB Session object, which is not supported by the current provider.

Does anyone know where I've gone wrong...?!

Thanks.
 
Should you first open the connection and then try to set your command object to the connection?
Code:
objConn.open
objCommand.ActiveConnection = objConn

--------------------------------------------------------------------------------------------------------------------------
Human beings, who are almost unique in having the ability to learn from the experience of others, are also remarkable for their apparent disinclination to do so.
--Douglas Adams
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top