Resposting an old-but-still-present problem.
Ok... I'm gonna try to post every detail I can.
- I'm using Windows 2000 Server. My workstation's name is WS12.
- I have an instalation of SQL Server 2000, with the default instance
name (WS12).
- I created a merge publication at my SQL Server 2000. I set
that option for SQL Server CE Databases. My database is "pesquisa", and the
publication name is "pesquisaCE".
- The default snapshot folder (AND the snapshot folder I configured at
my publication) is \\ws12\snapshot. I configured the sharing AND the
security options to let the user WS12\IUSR_WS12 with full control over the
folder.
- The snapshot agent runs successfully.
- At the "SQL Server CE Connectivity Management" I set the HTTP Content
Folder with read permission ("C:\Arquivos de programas\Microsoft SQL Server
CE 2.0\Server\"), the HTTP Authentication with Anonymous acess (for the user
WS12\IUSR_WS12), and at NTFS Permissions I configure the accesses:
- SQL Server CE Agent - Read & Execute, Write.
- Temporary File Location (C:\Arquivos de programas\Microsoft SQL
Server CE 2.0\Server\) - Read & Execute, Read, Write.
Then, clicking next, I check the option "One or more applications
requiring SQL Server Replication". And then I put the same path for the
snapshot folder, \\ws12\snapshot. Permissions: all of them, full access.
- At Enterprise Manager, I also do the following: created a login for
the user WS12\IUSR_WS12, with the defaul database set to "pesquisa", the
System Administrators server role, and the Public AND db_owner database
roles for the databases distribution AND pesquisa.
- Well... what else... I already set the SQL Server Agent to run over my
account (I'm at administrator's group), over Administrator's account,
whatever.
- At last: when I try to access the URL
"http://ws12/pesquisa/sscesa20.dll" from the pocket's (or emulator's)
INternet explorer, it DOES return me the expected: "SQL Server CE Server
Agent".
So... I'm trying to replicate the database to a Windows Mobile 2003,
using Visual Studio .Net 2003. Deploying on the Emulator or on the Device
the result is the same. I take the error message and write into a file on my
workstation. The error is:
24/8/2004 11:54:58 - Error:
(0) - (29045) Initializing SQL Server Reconciler has failed. [,,,,,]
(1) - (0) The process could not connect to Distributor 'WS12'.
(2) - (0) Data source name not found and no default driver specified
That's my C# code:
/*************************************************/
try
{
// Set the Replication object.
sqlReplication = new SqlCeReplication();
sqlReplication.InternetUrl =
"http://ws12/pesquisa/sscesa20.dll";
// sqlReplication.InternetLogin = "WS12\\IUSR_WS12";
// sqlReplication.InternetPassword = "ippasswd";
// sqlReplication.Distributor = "WS12";
// sqlReplication.DistributorSecurityMode =
SecurityType.NTAuthentication;
sqlReplication.Publisher = "WS12";
sqlReplication.PublisherDatabase = "pesquisa";
sqlReplication.Publication = "pesquisaCE";
sqlReplication.PublisherSecurityMode =
SecurityType.DBAuthentication;
sqlReplication.PublisherLogin = "sa";
sqlReplication.PublisherPassword = "sapasswd";
sqlReplication.SubscriberConnectionString = sSubscriberConnectionString;
sqlReplication.Subscriber = "SQLCE_PESQUISA_01";
// Create the Local SSCE Database subscription.
sqlReplication.AddSubscription(AddOption.CreateDatabase);
sqlReplication.Synchronize();
return true;
}
catch(SqlCeException e)
{
File.Delete(sDBFileName);
p_sError = "Error: " + Convert.ToChar(13) +
this.extractErrors(e.Errors);
return false;
}
/*************************************************/
The commented lines was already uncommented once. With no success.
The execution throws the exception on the Synchronize() method. The
AddSubscription creates the database file, that's why on every execution I
delete the file, when the exception is handled.
I tryed many combinations, did the same steps a lot of times...... but
the error is always the same. I got exhausted... please, some help! I
already made it work when I implemented the same thing for a Windows Mobile
2002, using EVB... and it works... so now I try to do the same thing at
Visual Studio .Net, "oh, that's powerful, that might work fine"........ and
nothing at all, still.
Thanks for any help...
Daniel.
--
--
Fudiotes, desencatum.
Vita brevis...
--
Pr bo entend me pala bas!
"Brian Sabino [MS]" <briansa@online.microsoft.com> escreveu na mensagem
news:OZpmIuXeEHA.2764@TK2MSFTNGP11.phx.gbl...
> You should be calling Sync() to do the first sync, not Reinit(). Also
make
> sure that you're calling AddSubscription on the database before the first
> sync.
>
> --
> This posting is provided "AS IS" with no warranties, and confers no
rights.
>
>
> "Flintstone" <spamme@internet.com> wrote in message
> news:uvJWFoVeEHA.2440@tk2msftngp13.phx.gbl...
> > "The SQL Server CE database is not enabled for replication. [,,,,,]"
> >
> > How do I solve that?
> >
> > - I created a merge replication (for SQL Server CE databases) at my SQL
> > Server 2000;
> > - I configured the connectivity stuff on my IIS, the snapshot folder,
> > permissions, etc. Runned the snapshot agent and "A snapshot of 7
> article(s)
> > was generated.";
> > - I'm using VS.NET 2003 to develop an application that creates a
> > subscription and accesses my SQL Server 2000 (testing on my emulator).
> > - I create the subscriptions configuring all parameters, it creates the
> > database on my pocket pc 2003 emulator (but not the tables, yet), and
when
> I
> > call ReinitializeSubscription(true) it throws and exception with the
> message
> > above.
> >
> > Thanks for any help.
> >
> > []s!
> > Daniel.
> >
> > --
> > Fudiotes, desencatum.
> > Vita brevis...
> >
> >
> >
>
>