Showing posts with label directly. Show all posts
Showing posts with label directly. Show all posts

Friday, February 24, 2012

Connecting Server Management Studio to a database on remote server


To use the front end tools in SQL Manager on the database at my ISP I want to connect directly from Server Management Studio ( Or Server explorer i VS). I have enabled TCP/IP without succes.

My installation is based on SQL Server Developer Edition and VS 2005. With my previos installation based on Express versions of the product this worked fine.

In VS 2005 I select Tools -> Connect to database and fill inn the dialog window with the serveraddress (sql01.active24.com), username and password. I then get the following message:

An errror has occurd while establishing a connection to the server. When connecting to SQL Server 2005, this failure may be caused by the fact that under the fefault settings SQL Server does not allow remote connections. (provider: Named pipes, errror: 40 - Could not opeen a connection to SQL Server

In the network configuration I have now disabled Named Pipes and enabled TCP/IP.

Thanks in advance!


Andreas

Report Abuse

Open the Surface Area Configuration (SAC) tool, and enable remote connections. By default the developer edition has all that turned off.

Buck Woody

Connecting Server Management Studio to a database on remote server


To use the front end tools in SQL Manager on the database at my ISP I want to connect directly from Server Management Studio ( Or Server explorer i VS). I have enabled TCP/IP without succes.

My installation is based on SQL Server Developer Edition and VS 2005. With my previos installation based on Express versions of the product this worked fine.

In VS 2005 I select Tools -> Connect to database and fill inn the dialog window with the serveraddress (sql01.active24.com), username and password. I then get the following message:

An errror has occurd while establishing a connection to the server. When connecting to SQL Server 2005, this failure may be caused by the fact that under the fefault settings SQL Server does not allow remote connections. (provider: Named pipes, errror: 40 - Could not opeen a connection to SQL Server

In the network configuration I have now disabled Named Pipes and enabled TCP/IP.

Thanks in advance!


Andreas

Report Abuse

Open the Surface Area Configuration (SAC) tool, and enable remote connections. By default the developer edition has all that turned off.

Buck Woody

Tuesday, February 14, 2012

COnnect VB6 to Sql Server

Hi! can anybody pls. help me. How Can i connect my VB6 Application to Sql server? is it posible to connect my VB6 application directly to sql server without any requirements in the client? thanks in advance!!!Declarative stuff:

'DSNless stuff
Private mobjConnect 'The object containing the connection.. declare it at whatever level you need.
' or you could specifically type it so you can see all the properties and
' methods assciated with in VBPrivate mobjConnect As ADODB.Connection

'These are the variables you'll need for connection or if you're a savage
' you can hard code them in to the method.
Private DB_NAME As String
Private SERVER_NAME As String
Private DB_USER As String
Private DB_PASS As String

Then as a property in the db class or just create it as a standard function:

Friend Property Get dbConnect() As Variant
'Private function GetdbConnect as variant
'Attempt to get a connection object.
If mobjConnect = Empty Or Not IsObject(mobjConnect) Then
'---------
' Don't check if there was an error
'Let the error permeate back to the calling object to report the error.
'---------
Set mobjConnect = CreateObject("ADODB.Connection")
'or use Dim objTmpConnect As New ADODB.Connection
mobjConnect.ConnectionTimeout = 90

If mbolWinAuth Then
'Use trusted
mobjConnect.ConnectionString = "Provider=SQLOLEDB" + ";SERVER=" + SERVER_NAME + ";DATABASE=" + DB_NAME + _
";Trusted_Connection=Yes;APP=MyApp" & App.Major & "." & App.Major & "." & App.Revision
Else
'Use application or client defined
mobjConnect.ConnectionString = "Provider=SQLOLEDB" & ";SERVER=" & SERVER_NAME & ";DATABASE=" & _
DB_NAME & ";User ID=" & DB_USER & ";Password=" & DB_PASS
End If

' open connection
mobjConnect.Open
End If

Set dbConnect= mobjConnect 'Return ref to connection object
End Property

So you then have this dbConnect object (or a reference to it) that you can use to execute SQL/sp's:

Dim objRS
Set objRS = CreateObject("ADODB.Recordset")
Set objRS = dbConnect.Execute("Select blah from blah")

If Not objRS.EOF Then
? = objRS.GetRows
'or
? = objRS.Fields("column_Name").Value
objRS.movenext
'..etc

Thats basically it...

Cheers
Phil
--
Some days you're the bug, some days you're the windscreen.

Friday, February 10, 2012

Connect to sql server 2000 via internet

I'm Building a windows application which updates an internet site's database.
Is it possible to connect directly to the sql server through the internet?
If so is it the most efficient way ? perhaps a web service or streaming is a better solution?
Thanks.If you can VPN into the server, using normal SQL Server connectivity will be best. Web Services certainly could do it, though this might not qualify as "most efficient." You could connect directly through the internet if the correct port (1433 as I recall) is open. Leaving this port open is not a great idea, security wise. That is why a VPN would be a better solution, if possible.