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
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
No comments:
Post a Comment