Showing posts with label connecting. Show all posts
Showing posts with label connecting. Show all posts

Thursday, March 29, 2012

Error Locating Server/Instance Specified

I am having a problem connecting to my sql server express instance from a remote computer. I continue to get the above mentioned error. If I connect for the localhost everything works fine however when I try to connect from a different computer on the LAN it gives me this error. I have turned on remote access and still no luck. Any ideas? Any help would be appreciated.

Odds are you haven't created exceptions in the firewall on the remote computer to allow SQL to communicate through it. Check out the complete instructions for enableing remote connections to SQL Express in the KB, http://support.microsoft.com/default.aspx?scid=kb;EN-US;914277.

FYI - This info is in the FAQ at the top of the forum is you need it again.

Mike

|||

Hi,

Ensure their is no network congesion between PCs you are connecting,

are they on same network segment !?

do you get ping acknoledgement when you ping your sql express from remote pc?

i would suggest you to refer http://support.microsoft.com/kb/905618/en-us also.

Hemantgiri S. Goswami

Error Locating Server/Instance Specified

I am having a problem connecting to my sql server express instance from a remote computer. I continue to get the above mentioned error. If I connect for the localhost everything works fine however when I try to connect from a different computer on the LAN it gives me this error. I have turned on remote access and still no luck. Any ideas? Any help would be appreciated.

Odds are you haven't created exceptions in the firewall on the remote computer to allow SQL to communicate through it. Check out the complete instructions for enableing remote connections to SQL Express in the KB, http://support.microsoft.com/default.aspx?scid=kb;EN-US;914277.

FYI - This info is in the FAQ at the top of the forum is you need it again.

Mike

|||

Hi,

Ensure their is no network congesion between PCs you are connecting,

are they on same network segment !?

do you get ping acknoledgement when you ping your sql express from remote pc?

i would suggest you to refer http://support.microsoft.com/kb/905618/en-us also.

Hemantgiri S. Goswami

Wednesday, March 21, 2012

Error in sql open statement

Hi,
I am new to sql server. I am trying to open a asp page by connecting to a
sql server database. The sql statement is coming correct. However I am
getting the following error:
ADODB.Connection (0x800A0E79)
Operation is not allowed when the object is open.
The error is happening to the following line of the code
conn.Open strSQL
Any help is appreciated here. Thanks.
CODE:
<!-- #include file="adovbs.inc" -->
<%
set conn = Server.CreateObject("ADODB.Connection")
set cmd = Server.CreateObject("ADODB.Command")
sConnString = "Provider=SQLOLEDB.1;User ID=sa;password=abcde;Initial
Catalog=manpowerweb;Data Source = DOJHLNBCC-003;Use Procedure for
Prepare=1;Auto Translate=True;Packet Size=4096"
Conn.Open sConnString
Set cmd.ActiveConnection = Conn
dim strSQL
UserID = request.Form("UserID")
Passwd = request.Form("password")
FirstName = request.Form("FirstName")
LastName = request.Form("LastName")
AgencyName = request.Form("AgencyName")
EmailAddress = request.Form("emailAddress")
PhoneNumber = Request.Form("PhoneNumber")
strcurrentdate = "'" & year(date) & "/" & month(date) & "/" & day(date) &
" " & hour(Now()) & ":" & minute(Now()) & ":" & second(Now()) & "'"
strSQL = "INSERT INTO tblApplicant (ApplicantUserID, ApplicantPassword,
ApplicantFirstName, ApplicantLastName, "
strSQL = strSQL & "ApplicantEmailAddress, ApplicantAgencyText,
ApplicantPhoneNumber, "
strSQL = strSQL & "ApplicantSysCreateDate, ApplicantSysModDate) "
strSQL = strSQL & "VALUES ('" & UserID & "', '" & passwd & "', '"
strSQL = strSQL & FirstName & "', '" & LastName & "', '" & EmailAddress &
"', '"
strSQL = strSQL & AgencyName & "', '" & PhoneNumber & "', '"
strSQL = strSQL & strcurrentdate & ", " & strcurrentdate & ")"
response.write strSQL & vbCRLF
'Response.end
Response.Write "This is before the execution of the sql statement" & "<br>"
conn.Open strSQL
Response.Write "This is after the execution of the sql statement" & "<br>"
%>> conn.Open strSQL
The Open method of an ADO Connection object expects a connection string, not
a SQL statement. You can use the Execute method to execute a SQL statement:
conn.Open strConnectionString
conn.Execute strSQL
conn.Close
Hope this helps.
Dan Guzman
SQL Server MVP
"Jack" <Jack@.discussions.microsoft.com> wrote in message
news:B901C4EE-D0CF-4C75-8CA8-823DE4BFF517@.microsoft.com...
> Hi,
> I am new to sql server. I am trying to open a asp page by connecting to a
> sql server database. The sql statement is coming correct. However I am
> getting the following error:
> ADODB.Connection (0x800A0E79)
> Operation is not allowed when the object is open.
> The error is happening to the following line of the code
> conn.Open strSQL
> Any help is appreciated here. Thanks.
> CODE:
> <!-- #include file="adovbs.inc" -->
> <%
> set conn = Server.CreateObject("ADODB.Connection")
> set cmd = Server.CreateObject("ADODB.Command")
>
> sConnString = "Provider=SQLOLEDB.1;User ID=sa;password=abcde;Initial
> Catalog=manpowerweb;Data Source = DOJHLNBCC-003;Use Procedure for
> Prepare=1;Auto Translate=True;Packet Size=4096"
>
> Conn.Open sConnString
> Set cmd.ActiveConnection = Conn
> dim strSQL
>
> UserID = request.Form("UserID")
> Passwd = request.Form("password")
> FirstName = request.Form("FirstName")
> LastName = request.Form("LastName")
> AgencyName = request.Form("AgencyName")
> EmailAddress = request.Form("emailAddress")
> PhoneNumber = Request.Form("PhoneNumber")
>
>
> strcurrentdate = "'" & year(date) & "/" & month(date) & "/" & day(date) &
> " " & hour(Now()) & ":" & minute(Now()) & ":" & second(Now()) & "'"
> strSQL = "INSERT INTO tblApplicant (ApplicantUserID, ApplicantPassword,
> ApplicantFirstName, ApplicantLastName, "
> strSQL = strSQL & "ApplicantEmailAddress, ApplicantAgencyText,
> ApplicantPhoneNumber, "
> strSQL = strSQL & "ApplicantSysCreateDate, ApplicantSysModDate) "
> strSQL = strSQL & "VALUES ('" & UserID & "', '" & passwd & "', '"
> strSQL = strSQL & FirstName & "', '" & LastName & "', '" & EmailAddress &
> "', '"
> strSQL = strSQL & AgencyName & "', '" & PhoneNumber & "', '"
> strSQL = strSQL & strcurrentdate & ", " & strcurrentdate & ")"
> response.write strSQL & vbCRLF
> 'Response.end
> Response.Write "This is before the execution of the sql statement" &
> "<br>"
> conn.Open strSQL
> Response.Write "This is after the execution of the sql statement" & "<br>"
> %>
>

Friday, March 9, 2012

Error in Merge Agent Replication

Dear All,
while connecting the merge agent after updates in the
subscriber , the following error occured
'the process could not enumerate changes at the subscriber'
Any reason why this error appears?
Waiting for ur feedback.
Thanks in advance
Dalia,
Could you enable logging on the merge agent (-output
c:\somefile.log -outputverboselevel 3) and we can see if
there is any more info to help.
Regards
Paul Ibison
|||does the error message complain about any missing stored procedures?
90% or more of merge replication errors can be clear by simply restart your merge agent. Can you try this to see if it clears the error message.

Friday, February 24, 2012

error in connection

Hi

i am trying to connect my application with SQL SERVER. but

it gives error as below.

When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections. (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server)

Please reply me soon.

Best regards,
ASIFU have to enable remote connections in SQL 2005 if u want to connect from remote clients.

1) Open SQL 2005 Surface Area configuration-->Surface Area configuration for Services and connections -->Database Engine-->Remote Connections-->Enable Local and remote connections.

2) Enable the protocol from SQl Server Configuration manager which u are using(in ur case 'Named Pipes').
To do that,
SQl Server Configuration manager -->SQL server 2005 Network Configuration-->Protocols for SQl2005-->Enabe Named Pipes.

Error in connecting to SQL Server Express

Hello,

I'm a newbie who is trying to create a connection to the server in my website application and I keep getting the following error: An error has occurred while establishing a connection to the server. When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections. (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server). I enabled TCP/IP and Pipe in the configuration and restarted the engine and server but I still get this error and it's stressing me out. Below is the code for the app. Any help would be greatly appreciated. Thanks

Imports

System.Data

Imports

System.Data.SqlClient

Partial

Class _DefaultInherits System.Web.UI.PageProtectedSub Page_Load(ByVal senderAsObject,ByVal eAs System.EventArgs)HandlesMe.Load' Create the database ConnectionDim connAsNew System.Data.SqlClient.SqlConnection( _"Server=Main;" + _"Integrated Security=True;" + _"Database=ShoppingCartData;" + _"AttachDBFilename=" + _"C:\DOCUMENTS AND SETTINGS\TONYA\MY DOCUMENTS\VISUAL STUDIO 2005\WEBSITES\ADO\APP_DATA\ADO.MDF")

' Create the Data Adapter with the required SELECT statementDim AdaptAsNew System.Data.SqlClient.SqlDataAdapter("SELECT * FROM Products", conn)' Create the dataset with the required informationDim dsADOAsNew System.Data.DataSet()

Adapt.Fill(dsADO)

Dim DRAs DataRow()' Define the TableDim ProdTblAsNew Table()' Create content for the Web PageForEach DRIn dsADO.Tables(0).Rows'Create a new table row.Dim ProdRowAsNew TableRow()'Create a cell within the row.Dim ProdCellAsNew TableCell()'Define content for the CellDim ThisLinkAsNew HyperLink()

ThisLink.NavigateUrl =

"Products.aspx?ProdID=" + _

DR(

"ProductID").ToString()

ThisLink.Text = DR(

"ProductNme").ToString()

ThisLink.ID = DR(

"ProductID").ToString()'Add the content to the cell and the cell to the row. Place the row in the table

ProdCell.Controls.Add(ThisLink)

ProdRow.Controls.Add(ProdCell)

ProdTbl.Controls.Add(ProdRow)

Next'Add the table to the Place holder.

phProducts.Controls.Add(ProdTbl)

EndSub

End

Class

That SQL Server Express instance must be local to connect to it. If it is locally installed just try changingServer=(local) to your connection.

Thanks

|||

Thank you for your reply. I have changed this as you've instructed, but it is still not working.

Thanks

|||

Hi,

Is this SQL Server on your local machine? If not, can you connect from the local one?

Also, you can test with a .UDL file. Here are the steps to create one.

1. Create a .txt file on desktop and rename it to .UDL.
2. Double click on the file and a Data Link Properties dialog box will appear.
3. You can test with this dialog box to see if it works fine on both remote and local machine.

Wednesday, February 15, 2012

error handling vbscript via sqlserver

Hi,

I wrote a small vbscript that sends information from a local computer to SQL server.
The method I use for connecting to the SQL server is via ODBC DSN.
This scripts runs on a DMZ located machine, while the SQL server is inside our LAN.

All works fine, but when the network connection between DMZ machine and SQL server lost
for a min. I receive an error.

I monitored the error and tried to error handle it.

after network is back the script is still on, but the error still there.

this is the part where I get the error:

-----------------------
Public function reso(byval res)

'error 3705 occurs here

objConn.Open strConn

Set objrs = objconn.Execute("exec cmp_creation "& Computer &"," & res)


objConn.Close

end function
-----------------------

Help would be much appreciatedWhy not use a DSN-less connection?

Also, if the server is in your DMZ and the SQL Server is behind a firewall (assumed), I would be sure to use the IP address instead of the network name.

Regards,

hmscott|||I'm not sure about the DSN-Less connection.... what would it change regarding my problem? also, what port do I have to open for a DSN-Less connection?|||I don't think that there's anything really wrong with a DSN connection and I'm not positive it would rectify your particular issue. However, DSN connections leave "footprints" on the server in your DMZ (in the registry) which are potentially vulnerable.

DSN and DSN-less connections use the same ports to connect to their respective data sources. Thus, a DSN connection to SQL Server would use port 1433 as would a DSN-less connection.

In general (from what I understand), DSN-less connections are "lighter" on the server, incurring less memory overhead. They are not, however, necessarily faster.

In your script, do you check for the state of the connection? Is it just opened once and left open? Or is it opened and closed as necessary?

Regards,

hmscott

Originally posted by eransp
I'm not sure about the DSN-Less connection.... what would it change regarding my problem? also, what port do I have to open for a DSN-Less connection?