locked
Failure to open SQL Server with given connect string RRS feed

  • Question

  • 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
    Sunday, March 11, 2007 8:17 PM

Answers

  • solution:

     rdaOleDbConnectString = "Provider=SQLOLEDB.1;Data Source=machineName,1433;Persist Security Info=False;Initial Catalog=praiateste;User ID=teste;Password=password;"
    Monday, March 12, 2007 4:54 PM

All replies

  • 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
    Monday, March 12, 2007 8:11 AM
  • 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!

    Monday, March 12, 2007 1:37 PM
  • 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.

    Monday, March 12, 2007 1:54 PM
  • 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.

    Monday, March 12, 2007 2:07 PM
  • Same error...

    :(
    Monday, March 12, 2007 3:37 PM
  • solution:

     rdaOleDbConnectString = "Provider=SQLOLEDB.1;Data Source=machineName,1433;Persist Security Info=False;Initial Catalog=praiateste;User ID=teste;Password=password;"
    Monday, March 12, 2007 4:54 PM
  • 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
    Thursday, April 12, 2007 9:17 AM
  • 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
    Thursday, April 12, 2007 11:23 AM