+ Reply to Thread
Results 1 to 7 of 7

error 80004005 while INITIALIZE sql server CE

  1. error 80004005 while INITIALIZE sql server CE

    Hi,

    Initializing replication, gives error 80004005...I am using SQL
    Authentication on my SQL Server i.e system account.
    Executing http://10.0.0.10/sql/sscesa20.dl displays "SQL Server CE
    Server Agent"
    Virtual dir is configured to use annanymous access.

    where am i wrong in my code?
    are there any additional steps to be followed.

    void InitializeReplicationRDA()
    {
    HRESULT hr;
    hr = CoInitializeEx(NULL, COINIT_MULTITHREADED); //initialize com port

    hr = CoCreateInstance(CLSID_Replication,
    NULL,
    CLSCTX_INPROC_SERVER,
    IID_ISSCEMerge,
    (LPVOID *)&CEMerge);
    if(FAILED(hr))
    {
    MessageBox (NULL, TEXT("THE DATABASE OBJECT COULD NOT BE
    CREATED"), TEXT("NO DATABASE CONNECTIVITY"), MB_OK);
    return;
    }
    else
    MessageBox (NULL, TEXT("INSTANCE SUCCESS"), TEXT("SUCCESS!!!"),
    MB_OK);

    CEMerge->put_InternetURL(L"http://10.0.0.10/sql/sscesa20.dll");
    CEMerge->put_InternetLogin(L"");
    CEMerge->put_InternetPassword(L"");
    CEMerge->put_Publisher(L"SQLSERVER");
    CEMerge->put_PublisherDatabase(L"southwind");
    CEMerge->put_Publication(L"southwind");

    CEMerge->put_PublisherSecurityMode((REPL_SECURITY_TYPE)DB_AUTHENTICATION);
    // CEMerge->put_PublisherSecurityMode(NT_AUTHENTICATION);

    CEMerge->put_PublisherLogin(L"sa");
    CEMerge->put_PublisherPassword(L"");
    CEMerge->put_PublisherNetwork((REPL_NETWORK_TYPE)DEFAULT_NETWORK);

    CEMerge->put_Subscriber(L"southwind");
    CEMerge->put_SubscriberConnectionString(L"Provider=microsoft.sqlserver.oledb.ce.2.0;Data
    Source=southwind.sdf");
    CEMerge->put_DistributorNetwork((REPL_NETWORK_TYPE)DEFAULT_NETWORK);
    CEMerge->put_DistributorSecurityMode((REPL_SECURITY_TYPE)DB_AUTHENTICATION);

    CEMerge->put_DistributorLogin(L"");
    CEMerge->put_DistributorPassword(L"");
    CEMerge->put_ExchangeType((REPL_EXCHANGE_TYPE)BIDIRECTIONAL);
    CEMerge->put_Validate(NO_VALIDATION);

    //ADD SUBSCRIPTION
    GetLocalTime(&systemtime);
    SystemTimeToFileTime(&systemtime, (FILETIME*)&timeStart);

    // hr = CEMerge->AddSubscription(CREATE_DATABASE);
    hr = CEMerge->AddSubscription(EXISTING_DATABASE);

    if (SUCCEEDED(hr))
    {
    GetLocalTime(&systemtime);
    SystemTimeToFileTime(&systemtime, (FILETIME*)&timeStop);
    timeTotal = ((double)(timeStop - timeStart) / 10000000);
    swprintf(wszBuffer, L"Subscription added\r\n\r\nElapsed time in
    seconds = %8.3f", timeTotal);
    MessageBox(NULL, wszBuffer, L" A D D S U B S C R I P T I O N ",
    MB_OK);
    }
    else
    {
    printf("%x",hr);
    MessageBox (NULL, TEXT("S U B S C R I P T I O N F A I L E D"),
    TEXT("error"), MB_OK);
    }

    //SYNCHRONIZE
    hr = CEMerge->Initialize();
    if (SUCCEEDED(hr))
    {
    MessageBox (NULL, TEXT("I N I T I A L I Z E SUCCESS"),
    TEXT("SUCCESS!!!"), MB_OK);
    fInitialized = TRUE;
    hr = CEMerge->Run();
    }
    else
    {
    printf("%x",hr);
    MessageBox (NULL, TEXT(" I N I T I A L I Z E F A I L E D"),
    TEXT("error"), MB_OK);
    }

    if (SUCCEEDED(hr))
    {
    MessageBox (NULL, TEXT("Run SUCCESS"), TEXT("SUCCESS!!!"), MB_OK);
    LONG lPubChanges;
    LONG lPubConflicts;
    LONG lSubChanges;
    GetLocalTime(&systemtime);
    SystemTimeToFileTime(&systemtime, (FILETIME*)&timeStop);
    timeTotal = ((double)(timeStop - timeStart) / 10000000);

    CEMerge->get_PublisherChanges(&lPubChanges);
    CEMerge->get_PublisherConflicts(&lPubConflicts);
    CEMerge->get_SubscriberChanges(&lSubChanges);

    swprintf(wszBuffer, L"Synchronization Complete\r\n\r\nElapsed time in
    seconds = %8.3f\r\nPublisher Changes = %d\r\nPublisher Conflicts =
    %d\r\nSubscriber Changes = %d", timeTotal, lPubChanges, lPubConflicts,
    lSubChanges);
    MessageBox(g_hwndMain, wszBuffer, L" S Y N C H R O N I Z E ",
    MB_OK);
    }
    else
    {
    printf("%x",hr);
    MessageBox (NULL, TEXT(" S Y N C H R O N I Z E F A I L E D"),
    TEXT("error"), MB_OK);
    }
    if (fInitialized)
    (void)CEMerge->Terminate();


    // Create and initialize the RDA object
    hr = CoCreateInstance(CLSID_RemoteDataAccess, NULL,
    CLSCTX_INPROC_SERVER, IID_ISSCERDA, (LPVOID *)&CERDA);
    CERDA->put_InternetURL(L"http://10.0.0.10/sql/sscesa20.dll");
    CERDA->put_InternetLogin(L"");
    CERDA->put_InternetPassword(L"");
    CERDA->put_LocalConnectionString(L"Provider=microsoft.sqlserver.oledb.ce.2.0;Data
    Source=southwind.sdf");
    wcscpy(wszConnectString, L"provider=sqloledb; data source=SQLSERVER;
    Initial Catalog=southwind; user id=sa; password=sa");
    wcscpy(wszLocalTable, L"southwind");
    wcscpy(wszErrorTable, L"southwinderr");
    wcscpy(wszQuery, L"select * from T1");


    //PULL
    // Invoke the RemoteDataAccess Object
    bstrConnectStr = SysAllocString(wszConnectString);
    bstrLocalTable = SysAllocString(wszLocalTable);
    bstrErrorTable = SysAllocString(wszErrorTable);
    bstrQuery = SysAllocString(wszQuery);

    hr = CERDA->Pull((WCHAR*)bstrLocalTable,
    (WCHAR*)bstrQuery,
    (WCHAR*)bstrConnectStr,
    TRACKINGON,
    (WCHAR*)bstrErrorTable);

    SysFreeString(bstrConnectStr);
    SysFreeString(bstrLocalTable);
    SysFreeString(bstrErrorTable);
    SysFreeString(bstrQuery);

    // Handle Errors
    if (SUCCEEDED(hr))
    {
    GetLocalTime(&systemtime);
    SystemTimeToFileTime(&systemtime, (FILETIME*)&timeStop);
    timeTotal = ((double)(timeStop - timeStart) / 10000000);
    swprintf(wszBuffer, L"Pull succeeded\r\n\r\nElapsed time in seconds =
    %8.3f", timeTotal);
    MessageBox(g_hwndMain, wszBuffer,L" R D A P U L L", MB_OK);
    }
    // else
    // ShowRDAErrors(L"Pull failed");

    TerminateReplicationRDA();
    return;
    }


  2. Re: error 80004005 while INITIALIZE sql server CE

    why isnt there anyone who can help me solve the problem

    I have the detailed description of the error here:

    Source: Microsoft SQL Server 2000 Windows CE Edition
    Native Error: 28507
    HR: 80004005
    Description: some distributor properties are not specified
    Param = 0
    Param = 0
    Param = 0
    Param =
    Param =
    Param =

    With reference to books online, the error is
    SSCE_M_MISSINGDISTRIBUTORPROPERTIES

    I tried giving sa as the user name and password for distributor with no
    avail.

    ~Sudha


  3. Re: error 80004005 while INITIALIZE sql server CE

    This is, unfortunately, a common problem and it seems that there is no
    generic solution. This seems to be the single most difficult hurdle
    when trying to use sql server ce.

    Basically, your connection information is incorrect in some way. How, I
    cannot say with any certainty.

    However, I will tell you that to get mine working, I had to provide
    valid values for these:

    CERDA->put_InternetLogin(L"");
    CERDA->put_InternetPassword(L"");

    But, that may not be your problem.

    You should also have a look at the SQL log on your server. It may give
    you some hints as to what exactly is failing.

    rick

    sudha wrote:
    > why isnt there anyone who can help me solve the problem
    >
    > I have the detailed description of the error here:
    >
    > Source: Microsoft SQL Server 2000 Windows CE Edition
    > Native Error: 28507
    > HR: 80004005
    > Description: some distributor properties are not specified
    > Param = 0
    > Param = 0
    > Param = 0
    > Param =
    > Param =
    > Param =
    >
    > With reference to books online, the error is
    > SSCE_M_MISSINGDISTRIBUTORPROPERTIES
    >
    > I tried giving sa as the user name and password for distributor with no
    > avail.
    >
    > ~Sudha



  4. Re: error 80004005 while INITIALIZE sql server CE

    hi Rick,
    Thanx for the reply...

    I removed lines defininig distributor properties from my above code and
    initialization worked fine. now the problem is with synchronisation

    I tried changing IIS account to a domain user and assigned the same
    values to
    CEMerge->put_InternetLogin(L"sudha");
    CEMerge->put_InternetPassword(L"");
    with no use.

    synchronizing gives the error:

    error 1 of 3
    Source: SQL Server 2000 Windows CE edition
    Native error: 29045
    HR: 80045901
    Description: initializing SQL server Reconciler has failed
    ....
    ....
    error 2 of 3
    Source: Merge process
    Native error: 0
    HR: 00004E74
    Description: The process could not connect to distributors 'SQLSERVER'
    ....
    ....
    error 3 of 3
    Source: 'SQLSERVER'
    Native error: 0
    HR: 00000011
    Description: SQL server does not exist or access denied
    ....
    ....
    * Snapshot folder 'REPLDATA' is created in c$. the folder is shatred
    and permissions set
    * Have set SQL SERVER logon permissions as user->sudha. Domain user
    sudha has administrative privilages. I am able to run SQL server on
    native system using this windows authentication
    * Virtual directory is set to use annonymous account and have set IIS
    annonymous account as user sudha instead of \\IUSR_computername
    * creating virtual folder sql sets the below permissions
    NTFS permissions for SUDHA
    On sql serer CE server agent: read and execute, read
    sscesa20.dll

    on temporary file location full, read and execute, read, write
    c:\program files\microsoft sql server CE 2.0\server\

    on sql snapshot folder full, read and execute, read, write
    \\RISPL0155KIR\C\REPLDATA
    * running http://rispl0155KIR/sql/sscesa20.dll displays "SQL server CE
    server Agent", both on my reader and native system with command
    http://localhost/sql/sscesa20.dll
    * i am able to ping SQL SERVER from an other system

    Here is my modified code

    void InitializeReplicationRDA()
    {
    HRESULT hr;
    hr = CoInitializeEx(NULL, COINIT_MULTITHREADED); //initialize com port
    hr = CoCreateInstance(CLSID_Replication,
    NULL,
    CLSCTX_INPROC_SERVER,
    IID_ISSCEMerge,
    (LPVOID *)&CEMerge);

    //INSTANCE is created without error

    CEMerge->put_InternetURL(L"http://rispl0155kir/sql/sscesa20.dll");
    CEMerge->put_InternetLogin(L"sudha");
    CEMerge->put_InternetPassword(L"");
    CEMerge->put_Publisher(L"SQLSERVER");
    CEMerge->put_PublisherDatabase(L"southwind");
    CEMerge->put_Publication(L"southwind");

    CEMerge->put_PublisherSecurityMode((REPL_SECURITY_TYPE)DB_
    AUTHENTICATION);
    CEMerge->put_PublisherSecurityMode(NT_AUTHENTICATION);

    CEMerge->put_PublisherLogin(L"sudha");
    CEMerge->put_PublisherPassword(L"");
    CEMerge->put_PublisherNetwork((REPL_NETWORK_TYPE)DEFAULT_N ETWORK);

    CEMerge->put_Subscriber(L"southwind");
    CEMerge->put_SubscriberConnectionString(L"Provider=microso
    ft.sqlserver.oledb.ce.2.0;Data
    Source=southwind.sdf");

    CEMerge->put_ExchangeType((REPL_EXCHANGE_TYPE)BIDIRECTIONA L);
    CEMerge->put_Validate(NO_VALIDATION);

    hr = CEMerge->AddSubscription(CREATE_DATABASE);

    if (SUCCEEDED(hr))
    {
    swprintf(wszBuffer, L"Subscription added\r\n\r\n");
    MessageBox(NULL, wszBuffer, L" A D D S U B S C R I P T I O N ",
    MB_OK);
    }
    else
    MessageBox (NULL, TEXT("S U B S C R I P T I O N F A I L E D"),
    TEXT("error"), MB_OK);

    //SUBSCRIPTION works without any error

    hr = CEMerge->Initialize();

    //NO ERROR TILL THIS POINT

    if (SUCCEEDED(hr))
    {
    MessageBox (NULL, TEXT("Run SUCCESS"), TEXT("SUCCESS!!!"), MB_OK);
    LONG lPubChanges;
    LONG lPubConflicts;
    LONG lSubChanges;
    GetLocalTime(&systemtime);
    SystemTimeToFileTime(&systemtime, (FILETIME*)&timeStop);
    timeTotal = ((double)(timeStop - timeStart) / 10000000);

    CEMerge->get_PublisherChanges(&lPubChanges);
    CEMerge->get_PublisherConflicts(&lPubConflicts);
    CEMerge->get_SubscriberChanges(&lSubChanges);

    swprintf(wszBuffer, L"Synchronization Complete\r\n\r\nElapsed time in
    seconds = %8.3f\r\nPublisher Changes = %d\r\nPublisher Conflicts =
    %d\r\nSubscriber Changes = %d", timeTotal, lPubChanges, lPubConflicts,
    lSubChanges);
    MessageBox(g_hwndMain, wszBuffer, L" S Y N C H R O N I Z E ",
    MB_OK);
    }
    else
    MessageBox (NULL, TEXT(" S Y N C H R O N I Z E F A I L E D"),
    TEXT("error"), MB_OK);

    if (fInitialized)
    (void)CEMerge->Terminate();
    ....
    ....

    Now where on earth am i doing wrong....i have spent umpteen hrs on net
    for solution with no avail

    Rehards,
    sudha


  5. Re: error 80004005 while INITIALIZE sql server CE

    I haven't experienced the error "Initializing SQL Server Reconciler has
    failed" myself, but there's some discussion about it here:

    http://www.dbforums.com/showthread.php?t=926219

    Perhaps what they're saying there might help.

    rick


  6. Re: error 80004005 while INITIALIZE sql server CE

    Hi rick,
    i have already posted my query there too...and also at sqlmonster
    hope i get a solution soon....2 weeks and i am still stuck with the
    same problem
    thank you for your time....

    Sudha


  7. It Works

    Finally....i have replication working successfully.

    here are the changes i have done...

    1. open enterprise manager -> right click on server name -> properties
    -> replication -> select "add as a distributor in the
    replication monitor group"

    2.

    CEMerge->put_InternetURL(L"http://RISPL0155KIR/sqlce/sscesa20.dll");
    CEMerge->put_InternetLogin(L"IUSR_RISPL0155KIR");
    CEMerge->put_InternetPassword(L"");
    CEMerge->put_Publisher(L"RISPL0155KIR\\SQLSERVER");
    CEMerge->put_PublisherDatabase(L"southwind");
    CEMerge->put_Publication(L"southwind-publication");
    CEMerge->put_PublisherSecurityMode(NT_AUTHENTICATION);
    CEMerge->put_PublisherLogin(L"sudha"); //domain
    user
    CEMerge->put_PublisherPassword(L"");
    CEMerge->put_PublisherNetwork((REPL_NETWORK_TYPE)DEFAULT_NETWORK);
    CEMerge->put_Subscriber(L"southwind");

    CEMerge->put_SubscriberConnectionString(L"Provider=microsoft.sqlserver.oledb.ce.2.0;Data
    Source=\\RBIDAM\\southwind.sdf");
    CEMerge->put_ExchangeType((REPL_EXCHANGE_TYPE)BIDIRECTIONAL);
    CEMerge->put_Validate(NO_VALIDATION);

    //ADD SUBSCRIPTION
    GetLocalTime(&systemtime);
    SystemTimeToFileTime(&systemtime, (FILETIME*)&timeStart);
    .....
    .....
    .....


    Regards,
    Sudha


+ Reply to Thread