Hi Kumar,
A couple of changes. The 'Data Source' should point to the server name or address 'Data Source=TESTSERVER'. The connection open method parameters doesn't look right to me. The first one is the connection string and "USHM" doesn't look as one. The second and third parameters are login name and pasword. You've to provide them if you're using SQL security or ommit them alltogether otherwise. It should be
oConnection.open(, < SQL user name >, < password >)
oConnection.open()
>Hi All,
> Basically I need to create a Web service on my machine. So I ‘ve created a ADO interface to connect to my SQL Server for accessing the tables. I have the following problem when I open the database using oConnection.Open. Error Message: OLE Idispatch exception code 0 from Microsoft OLE DB Provider for SQLServer:[DBNETLIB][ConnectionOpen(Connect().]Sql Server does not exist or access denied.
>
>I don’t know what is the problem? May be I am having security rights?
>Please help.
>
>Thanks,
>
>Code:
> LOCAL oConnection as Variant
> LOCAL loCommand as Variant
> oConnection = CREATEOBJECT("ADODB.connection")
> WITH oConnection
> .Provider = "SQLOLEDB.1"
> .ConnectionString = "Persist Security Info=False;
> Data Source=TESTSERVER\USHM;
> Auto Translate=True;Use Encryption for Data=False;
> Tag with column collation when possible=False"
> ENDWITH
> oConnection.open("USHM"," "," ")
--sb--