Sql Server 2005 Mobile/RDA connection problem

I have a working Pocket PC 2003 app that uses RDA to exchange data with SQL Server 2000.  I'm attempting to port it to a Windows CE 5.0 device.   (I'll be porting to Mobile 5 in the near future, but the gadget I have at the moment is CE). 

I installed SQL Server 2005 Mobile Edition on the computer running IIS according to package directions, and used the wizard to set up a virtual directory with sscesa30.dll.

The directory I was previously using with sscesa20.dll is still there, and still works.

I set up the virtual directory to use basic authentication without SSL.  (I know that's not advisable).  I have confirmed that I can reach the URL using the username and password I supplied to the wizard.

When I try to pull data I get the following:

------------------- SQL CE Exception
Error Code: 80004005
Message   : An error has occurred on the computer running IIS. Try restarting the IIS server.
Minor Err.: 28022
Source    : Microsoft SQL Server 2005 Mobile Edition

I have tried restarting IIS without effect.  Any clues

 



Answer this question

Sql Server 2005 Mobile/RDA connection problem

  • rfb

    There are two tiers of security you have to get through to connect. The first is IIS, the second is NTFS (NT File System).

    Sounds like you have a problem with the NTFS permissions. The SQL Mobile connection wizard is supposed to set this up for you when you create the virtual directory, but something may have gone wrong or been changed after the wizard did its thing.

    Go through the SQL Mobile Web Synchronization wizard again. When you get to the "Web Server" page, check "Configure an existing virtual directory," then select your existing "test" virtual directory in the explorer.

    On the next page, note the local path you are using. I'll assume it's c:\SqlMobile\Test.

    Hit "Next" until you get to the Client Authentication page, and confirm that "Clients will connect anonymously..." is checked.

    On the next page, note the user account that is used for anonymous authentication. It's probably IUSR_TESTSERVER in your case.

    Click "Next" again (not "Finish"). You should see something like this:

    Click Finish to perform the following actions:

    Modify a virtual directory immediately.

    Set NTFS permissions immediately.

    The virtual directory 'Test' will be configured with the following options:

    On server 'TestServer'.

    Use 'Test' as the alias.

    Use 'C:\SqlMobile\Test' as the physical path for the virtual directory.

    Use 'Anonymous' as the authentication method(s).

    Do not require secure channel.

    Set user permissions to 'Execute'.

    Clients can use 'http://TestServer/Test/sqlcesa30.dll' as the Internet URL.

    'IUSR_TESTSERVER' will get the following NTFS permission:

    'Read & Write' on physical path 'C:\SqlMobile\Test'.

    'Read & Execute' on the ISAPI DLL 'C:\SqlMobile\Test\sqlcesa30.dll'.

    Click "Finish" and try again. Try it first from the desktop, and enter the url http://TestServer/Test/sqlcesa30.dll diag

    You should get a page with diagnostic information. If that works, try entering the same url in Internet Explorer on the PDA. If that works, you are home free.

    Otherwise, confirm that the NTFS permissions have been set as indicated by the connection wizard. Right click the item in Windows Explorer, select "properties," select the "security" tab, and confirm that IUSR_TESTSERVER has the required permissions. If not, set them correctly and try again.

    If you can't set the permissions, or if you set them and still get the 403 error, the problem is beyond my ken. You'll have to go a googling. One word of caution if you reach this point. Most articles you find will talk about a problem with the default page settings for the virtual directory. These are *not* relevant to the problem you are experiencing.

    Happy hunting.


  • carlosalvidrez

    hi

    i am using pull method to pulldata from sql server2000 to sqlce 2.0 on wince emulator using vs 2003

    i have configured iis according to manual on sql server mobile edition 2005 books online

    but i am getting SqlCeException error message

    can u give details how to configure iis and why i am getting this message

    thanks in advance

    arvind



  • ry383

    You should use the Compact Edition server tools, as they are more recent than Mobile Edition server tools. The replication components must be installed from the SQL Server 2005 media, and I recommend that you install Service pack 2 for SQL Server 2005 on both your database server and on the web server. For a walkthrough, see Rob Tiffany's excellent book, chapter 4. Look here for links to all chapters: http://erikej.blogspot.com/2007/10/rob-tiffany-publishes-mobile-merge.html



  • Jagadisk Kulkarni

    Thanks, Eric. Rob Tiffany's book is very thorough. To go directly to downloadable versions of the chapters, use this link:

    http://blogs.msdn.com/robtiffany/archive/2007/09/18/chapters-1-4-are-feature-complete.aspx

    Steve, it appears that my information was out of date. As Erik points out, SQL Mobile has been superceded by SQL Server Compact Edition 3.1. (This is *not* the same as SQL Server CE referenced in earlier posts.) The installation package should be included in your SQL Server 2005 installation. By default, you will find it at:

    C:\Program Files\Microsoft SQL Server\90\Tools\Binn\VSShell\Common7\IDE\sqlce30setupen.msi.

    In summary:

    • Install SQL Server 2005 Service Pack 2 if you haven't done so. For information and downloads, see http://technet.microsoft.com/en-us/sqlserver/bb426877.aspx
    • Uninstall SQL CE Server Tools, and SQL Mobile Server Tools if you have installed them.
    • Install SQL Compact Edition 3.1 Server Tools.

    None of this relates specifically to the Error 403 connectivity issue, which is preventing you from accessing any DLL, right or wrong. Use the Compact Edition setup wizard to create a new virtual directory, then verify that the NTFS permissions are set correctly, as outlined in the earlier post.


  • AntonieB123

    Hi,

    Encounter the same error when execute rda.Pull(... ).

    I am using WinCE 5.0 ans SQL Mobile... I am doing 2 projects but working ok. It works fine with PocketPC 2003 and SQL Mobile...the only difference is the PPC device application is wireless and WinCE 5.0 device is using usb to download data. Does it make a difference...

    Please Help,

    michael



  • zaabdullah

    Andy,

    First, let me apologize for not noticing your post until now - the MSDN Forums seem to have no rhyme or reason in terms of what page a new post shows up on.

    Next, the server-side DLL that brokers RDA and merge replication between SQL CE or SQL Mobile and SS2000 or SS2005 has to match both the client database and server database. If you are using SQL Mobile on device, then the old virtual directory in which you have sscesa20.dll installed is not suitable for RDA. You must install the SQL Mobile version of the Server Tools. You can in fact place the SQL Mobile server tools DLL (sqlcesa30.dll) in the same virtual directory, but your issue is almost certainly that you re trying to use SQL Mobile on device (with the SQL mobile client tools) and they are failing to communicate with the SQL CE server tools on the IIS server.

    -Darren



  • Joe Rohde

    If you are using SQL CE 2.0 on the device, you have installed the wrong replication components on the IIS server. You need to refer to the SQL Server CE 2.0 books online (not SQL Server Mobile 2005) for setup instructions, or refer to the link below. Here's some more info that you may find useful:

    First, note that there are 4 players involved:
    1. SQL Server on the database server
    2. SQL Server replication components on the IIS server (which may or may not be the same as the database server)
    3. SQL Server CE 2.0 or SQL Server Mobile Server Tools on the IIS server
    4. SQL Server CE 2.0 or SQL Server Mobile on the device

    If you are running SQL Server 2000, there may be a minimum service pack that needs to be installed, depending on the version of Sql Server on the device.

    The SQL Server replication components must match the version of SQL Server (including the service pack) you are running on the database server.

    The SQL Server CE/Mobile server tools must match the version of SQL Server on the device.

    You can find a matrix detailing the various configurations, along with setup instructions and links to the required components here:
    http://www.microsoft.com/sql/editions/sqlmobile/connectivity-tools.mspx

    (Update: The latest version of SQL Server for devices is called SQL Server Compact Edition 3.1. It is not included in the matrix referenced above. For more information, see the posts from myself and ErikEJ further down the thread.)

    Once you have both sets of replication components installed on IIS, you can test the configuration simply by entering the url in Internet Explorer. With SQL Server Mobile, you can also get some additional diagnostic info.

    For SQL Server CE enter something like this, substituting your URL and replication folder:
    http://127.0.0.1/CEReplication/sscesa20.dll

    For SQL Server Mobile, enter something like:
    http://127.0.0.1/MobileReplication/sqlcesa30.dll diag

    Note the differences in spelling between the two dlls. The problem I had when I initiated this thread was simply that I had changed the URL from sscesa20 to sscesa30 (rather than sqlcesa30). It took me a long time to figure this out.

    Depending on how you've set up security, you may need to enter a username/password. Then you should get the following response:

    For SQL Server CE, you'll get a page that says simply "SQL Server CE Server Agent."
    http://127.0.0.1/CEReplication/sscesa20.dll

    For SQL Server Mobile, you'll get a page with the header "SQL Server Mobile Server Agent Diagnostics" followed by a lot of other information. One thing to note is that if you are using RDA, only (not merge replication) it doesn't matter if the diagnostics show failure on the "Reconciler Test." All the other sections should show success. For more information, see:
    http://msdn2.microsoft.com/en-us/library/ms171873.aspx

    Finally, here are the SQL Mobile Error codes. It's unlikely that these will be useful. I've never seen any of them except the first one, but I thought I would pass them along:

    80004005-Unspecified error
    8000FFFF-Unexpected error
    80070008-Out of memory
    8007000E-Out of memory
    80072ee1-cannot create any more ServerXMLHTTP objects, cannot exceed 5460 concurrent objects per process
    80072ee2-The operation timed out
    80072ee4-internal error
    80072ee5-URL is invalid
    80072ee7-The server name or address could not be resolved
    80072eee-incorrect password
    80072eef-authentication failure
    80072efd-A connection with the server could not be established
    80072efe-connection aborted
    80072eff-connection reset
    80072f05-The date in the certificate is invalid or has expired
    80072f06-The host name in the certificate is invalid or does not match
    80072f07-A redirect request will change a non-secure to a secure connection
    80072f08-A redirect request will change a secure to a non-secure connection
    80072f0c-A certificate is required to complete client authentication
    80072f0d-The certificate authority is invalid or incorrect
    80072f0e-Client authentication has not been correctly installed
    80072f76-The requested header was not found
    80072f78-The server returned an invalid or unrecognized response
    80072f7-The request for a HTTP header is invalid
    80072f7c-The HTTP redirect request failed
    80072f7d-An error occurred in the secure channel support
    80072f80-The HTTP request was not redirected
    80072f82-A cookie from the server has been declined acceptance
    80072f88-The HTTP redirect request must be confirmed by the user
    80072f89-The server certificate was invalid


  • jacopo

    Many thanks Andy for your assistance. Could you please also confirm something that may or may not be an issue. We installed the Sql Compact Edition Server Tools and it displayed a warning concerning the Replication software. We subsequently downloaded Sql2Kensp3a which is for Sql 2000 and not Sql 2005. We have discovered that if you install Sql Mobile edition Server Tools, it installs the Replication software for you. Therefore, we planned to uninstall The Sql CE Server Tools and then install Sql Mobile edition Server Tools instead and reconfigure a new Virtual directory under the Mobile Edition Web Sync Wizard following the guidelines you have set out above.

    Could you please confirm we are correct in our assumption and that we do not need to install Sql CE server Tools after installing the Mobile edition ST and this is what may have caused our connection problem.


  • douglasp

    Darren,

    Thanks for the reply, but I don't think you got the whole story.

    As noted in my original post, I installed the correct version of the server components. I was attempting to connect via the url with sscesa30.dll when I encountered the problem.


  • Warren13

    Has anyone found a solution to this issue

    I am using the sqlmobile server tools.

    I was using sqlce 2.0 with no problems in my app [RDA]

    now I am trying to port to sql mobile. I installed the tools on the iis server. and I changed the url to point to the new dll.

    I keep getting this error.

    any ideas


  • Ivan Selchenkov

    Just to be sure, have you installed the correct version of SQL Mobile as described in my original post and reiterated by Darren Shaffer The url you use to sync should be pointing to an instance of sscesa30.dll.

    I haven't revisited this lately because the WinCE device I was evaluating was a loaner, and I have returned it. I will be testing the same app on a Mobile 5 device in the next week or two. I will let you know if the results are different, or if I get any new insights.


  • ShaunS

    Hi,

    I'm also having the same issue.
    My code is,

    SqlCeRemoteDataAccess rda = new SqlCeRemoteDataAccess();
    String ServerOledbStr = "Provider=sqloledb; Data Source=SRV1;Initial Catalog=POC;User Id=sa;Password=soft2007";

    rda.LocalConnectionString = "Data Source = POC.sdf";
    rda.InternetUrl = "http://localhost/SQLCE/sscesa30.dll";

    rda.Pull("Tab1", "Select * from Tab1", ServerOledbStr);

    Error Msg: An error has occurred on the computer running IIS. Try restarting the IIS server.

    I'm using Pocket PC 2003 SE Emulator
    Visual Studio 2005
    SqlserverCE Version: 3.0.3600.0

    How do i sove this

    Thanks.








  • Ashish Nayyar

    Read your comments with interest Andy. We have a Sql 2005 database on a separate dedicated server and are trying to connect to a separate web server where we have installed Sql CE Server Agent. We have configured the Virtual directory for anonymous access to keep things simple. However, when we enter the url on the pda pointing to the web server (http://testweb/test/sqlcesa30.dll), it tells we are not authorised to open this page. As we are simply trying to get a connection with the web server agent, Sql 2005 does not even come into play yet. We have noticed that we may have installed the wrong replication software ( for 2000 and not 2005), we can install Sql mobile edition which install replication software for Sql 2005. Could this be where we are going wrong or have we missed something else. Would really appreciate you comments.


  • Sql Server 2005 Mobile/RDA connection problem