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

Friday, February 24, 2012

Failure to open SQL Server with given connect string

hello,

im working with VB 2005 and i have this error when triyng to connecting to the server database from my pocket pc application.

"Failure to open SQL Server with given connect string."

this is part of my code:


rdaOleDbConnectString = "Provider=sqloledb;Data Source=localhost;Persist Security Info=SSPI;User ID=id;Password=password;Initial Catalog=praia"

rdaUrl = "http://server/SqlMobile/sqlcesa30.dll"
localConnection = "Data Source=\My Documents\PraiaDB6.sdf"

If File.Exists("\My Documents\PraiaDB6.sdf") Then
File.Delete("\My Documents\PraiaDB6.sdf")
End If

Dim engine As New SqlCeEngine
engine.LocalConnectionString = localConnection
engine.CreateDatabase()
engine.Dispose()
MsgBox("DB Mobil empty created!")

'Init RDA Object
Dim rda As SqlCeRemoteDataAccess = Nothing

rda = New SqlCeRemoteDataAccess(rdaUrl, localConnection)
rda.InternetUrl = rdaUrl
rda.LocalConnectionString = localConnection
rda.Pull("Reserva", "select * from Reserva", rdaOleDbConnectString, RdaTrackOption.TrackingOn)
rda.Dispose()

the problem is in rda.Pull(...)
it can not connect to rdaOleDbConnectString

please help me
Thanks!

Jo?o
It is not likely that the datasource is "localhost", as this refers to the Pocket PC device, it should probably be the machine name or the ip address of the machine running SQL Server|||

Hi ErikEJ, thanks for the reply

i also tried the connectString with the machine name, like : Data Source=machinename; and i got the same error

also tried the ip adress of the server..

i dont understand whats supose the connect string look like...

anybody? thanks!

|||

Can you connect via Internet Explorer on the device to: http://server/SqlMobile/sqlcesa30.dll
If that is not possible, this may be the cause of the error.

|||

yes i can!

i read somewhere that when connecting via device (ppc) its need it to put ip adress instead server name.

i've found this link and im going to try now with this connecting string. ill post the result. thanks in advance for your help

http://www.connectionstrings.com/?carrier=sqlserver2005

Connect via an IP address

Data Source=190.190.200.100,1433;Network Library=DBMSSOCN;Initial Catalog=myDataBase;User ID=myUsername;Password=myPassword;

Jo?o.

|||Same error...

:(
|||solution:

rdaOleDbConnectString = "Provider=SQLOLEDB.1;Data Source=machineName,1433;Persist Security Info=False;Initial Catalog=praiateste;User ID=teste;Password=password;"
|||hello,

i was olso working on RDA sync and with the same connection string but in C# and i'm having the same problem the error message i'm getting is:

Failure to open SQL Server with given connect string. [connect string = Provider=SQLOLEDB.1;Data Source=localhost; Persist Security Info= True; User ID=MobileUser;Password=password;Initial Catalog=MobileDemo; ]

i'd tryed out all the alternatives posted on the forum but i'm still getting the same error the intial connection string was:

@."Provider=SQLOLEDB.1;Data Source=localhost;Persist Security Info=True;User ID=MobileUser;Password=password;Initial Catalog=MobileDemo";

hope you can help me thanks|||rdaOleDbConnectString = "Provider=SQLOLEDB.1;Data Source=machineName,1433;Persist Security Info=False;Initial Catalog=praiateste;User ID=teste;Password=password;"

try using the actual server name and open the port 1433 at SQL server

Failure to open SQL Server with given connect string

hello,

im working with VB 2005 and i have this error when triyng to connecting to the server database from my pocket pc application.

"Failure to open SQL Server with given connect string."

this is part of my code:


rdaOleDbConnectString = "Provider=sqloledb;Data Source=localhost;Persist Security Info=SSPI;User ID=id;Password=password;Initial Catalog=praia"

rdaUrl = "http://server/SqlMobile/sqlcesa30.dll"
localConnection = "Data Source=\My Documents\PraiaDB6.sdf"

If File.Exists("\My Documents\PraiaDB6.sdf") Then
File.Delete("\My Documents\PraiaDB6.sdf")
End If

Dim engine As New SqlCeEngine
engine.LocalConnectionString = localConnection
engine.CreateDatabase()
engine.Dispose()
MsgBox("DB Mobil empty created!")

'Init RDA Object
Dim rda As SqlCeRemoteDataAccess = Nothing

rda = New SqlCeRemoteDataAccess(rdaUrl, localConnection)
rda.InternetUrl = rdaUrl
rda.LocalConnectionString = localConnection
rda.Pull("Reserva", "select * from Reserva", rdaOleDbConnectString, RdaTrackOption.TrackingOn)
rda.Dispose()

the problem is in rda.Pull(...)
it can not connect to rdaOleDbConnectString

please help me
Thanks!

Jo?o
It is not likely that the datasource is "localhost", as this refers to the Pocket PC device, it should probably be the machine name or the ip address of the machine running SQL Server|||

Hi ErikEJ, thanks for the reply

i also tried the connectString with the machine name, like : Data Source=machinename; and i got the same error

also tried the ip adress of the server..

i dont understand whats supose the connect string look like...

anybody? thanks!

|||

Can you connect via Internet Explorer on the device to: http://server/SqlMobile/sqlcesa30.dll
If that is not possible, this may be the cause of the error.

|||

yes i can!

i read somewhere that when connecting via device (ppc) its need it to put ip adress instead server name.

i've found this link and im going to try now with this connecting string. ill post the result. thanks in advance for your help

http://www.connectionstrings.com/?carrier=sqlserver2005

Connect via an IP address

Data Source=190.190.200.100,1433;Network Library=DBMSSOCN;Initial Catalog=myDataBase;User ID=myUsername;Password=myPassword;

Jo?o.

|||Same error...

:(|||solution:

rdaOleDbConnectString = "Provider=SQLOLEDB.1;Data Source=machineName,1433;Persist Security Info=False;Initial Catalog=praiateste;User ID=teste;Password=password;"|||hello,

i was olso working on RDA sync and with the same connection string but in C# and i'm having the same problem the error message i'm getting is:

Failure to open SQL Server with given connect string. [connect string = Provider=SQLOLEDB.1;Data Source=localhost; Persist Security Info= True; User ID=MobileUser;Password=password;Initial Catalog=MobileDemo; ]

i'd tryed out all the alternatives posted on the forum but i'm still getting the same error the intial connection string was:

@."Provider=SQLOLEDB.1;Data Source=localhost;Persist Security Info=True;User ID=MobileUser;Password=password;Initial Catalog=MobileDemo";

hope you can help me thanks|||rdaOleDbConnectString = "Provider=SQLOLEDB.1;Data Source=machineName,1433;Persist Security Info=False;Initial Catalog=praiateste;User ID=teste;Password=password;"

try using the actual server name and open the port 1433 at SQL server

Failure to connect error

I recently got a new computer that I use to connect to a SQL 2000 Server and
as soon as I started connecting to the server using QA and EM, the Air Force
base communications center called saying they were showing 1700 failure to
connect messages on ports, 1134,139, and 445. I connect just fine with no
errors and performance is just fine. I am assuming my new computer has some
protocol enabled that is sending broadcast messages to the server on these
ports that are not required and also on the bases hit list. Any Ideas?
OK,,,Found the culprit. I had Server State polling turned on. This is
located under Tools_Opotions of the Enterprise Manager. Seems my machine was
going out every second on port 1434 and the firewall was responding on port
445 saying no can do. I think the Slammer virus used 1434 so thats why it was
disabled. Also I had NetBios enabled in the TPC/IP properties.
"AkAlan" wrote:

> I recently got a new computer that I use to connect to a SQL 2000 Server and
> as soon as I started connecting to the server using QA and EM, the Air Force
> base communications center called saying they were showing 1700 failure to
> connect messages on ports, 1134,139, and 445. I connect just fine with no
> errors and performance is just fine. I am assuming my new computer has some
> protocol enabled that is sending broadcast messages to the server on these
> ports that are not required and also on the bases hit list. Any Ideas?

Failure to connect error

I recently got a new computer that I use to connect to a SQL 2000 Server and
as soon as I started connecting to the server using QA and EM, the Air Force
base communications center called saying they were showing 1700 failure to
connect messages on ports, 1134,139, and 445. I connect just fine with no
errors and performance is just fine. I am assuming my new computer has some
protocol enabled that is sending broadcast messages to the server on these
ports that are not required and also on the bases hit list. Any Ideas?OK,,,Found the culprit. I had Server State polling turned on. This is
located under Tools_Opotions of the Enterprise Manager. Seems my machine wa
s
going out every second on port 1434 and the firewall was responding on port
445 saying no can do. I think the Slammer virus used 1434 so thats why it wa
s
disabled. Also I had NetBios enabled in the TPC/IP properties.
"AkAlan" wrote:

> I recently got a new computer that I use to connect to a SQL 2000 Server a
nd
> as soon as I started connecting to the server using QA and EM, the Air For
ce
> base communications center called saying they were showing 1700 failure to
> connect messages on ports, 1134,139, and 445. I connect just fine with no
> errors and performance is just fine. I am assuming my new computer has som
e
> protocol enabled that is sending broadcast messages to the server on these
> ports that are not required and also on the bases hit list. Any Ideas?