Page 1
Page 2
Lets get dirty...
- Create a Local Directory
(walkthrough
- 926kb/45 sec)
This local directory will contain the Server Agent DLL
(sscesa10.dll) which is an ISAPI DLL that will relay push/pull
requests to SQL Server from our client. Our first step,
is to create a directory on the machine and place the
DLL in it. You can find the DLL in the following directory:
C:\Program Files\Microsoft
SQL Server CE\Server
- Register the Server Agent DLL
This is an easy step. Register the DLL from START -->
RUN. In this project, I have placed the file in a folder
off of the Inetpub directory.
Regsvr32 c:\inetpub\ssce\sscesa10.dll
- Change
DLL Permissions (walkthrough
- 1.68mb/1:37 sec)
When your virtual directory goes live, the DLL will be
exposed to the public. This means that you will need to
limit how the public can use the DLL. In this step, we
will need to limit what someone can do with the DLL by
altering the permissions and access control list.
- Change
Directory Permissions (walkthrough
- 1.25mb/1:03 sec)
Same deal.
- Create
Virtual Directory (walkthrough
- 2.23mb/1:50 sec)
Now that our directory is ready, and with appropriate
permissions - we will need to create a Virtual Directory
in IIS to make it available to the public. This exposes
the Server Agent to a web interface, which we will use
via CE Relay to push / pull information to / from SQL
Server.
- Verify
Server Agent Install (walkthrough
- 962kb/50 sec)
Once you have the virtual directory setup properly, you
can verify your configuration with this test.
Keep in mind that just because you see 'Body' in the browser
window doesn't mean that the Server Agent can access SQL
Server. This only means that the Server Agent is configured
correctly as far as IIS is concerned. In other words,
you have passed the first authentication step - SQL Server
setup is next.
- IUSR_computername
for SQL Server (walkthrough
- 1.42mb/1:13 sec)
Server Agent will use the IUSR_computername account to
forward requests to SQL Server - which means that this
user needs to have access to the database that your app
is connected to! Now the Server Agent (using the IUSR_Computername)
account can get to SQL Server.
- Start
SQL Server Relay (walkthrough
- 1.12mb/1:06 sec)
SQL Server Relay lets the client (your handheld) use your
desktops network connection to communicate with IIS and
SQL Server Agent. In this project, it's a simple redirect
to localhost.
- Code
an Application (RDA_app.zip
- 3.6kb)
I have included a simple fully functional app for you
to look at. I have always been a fan of simple examples,
although you are willing to take a look at the eVB example
included in the SQL Server CE directory.
C:\Program Files\Microsoft SQL
Server CE\Samples\eVB
The only change you will need to make is the IP address
(most likely).
- Check Your Setup
(walkthrough
- 817kb/1:04 sec)
Run the app on your Pocket PC, and when you click 'pull'
you should see the little lights in SSCERelay doing their
thing. If you do - congratulations! Add SQL Server CE
RDA to your resume!
Top Five Blunders (Troubleshooting)
- Pull
Errors: usually result from a bad path. If the
SQL Server Agent is in a virtual directory named "ssce,"
and you accidentally set the ceRDA.InternetURL = "http://192.168.0.15/sqlce/sscesa10.dll"
- this will generate a PULL error. The paths must be the
same.
- Authentication
Failed: happens when you have the Virtual Directory's
Directory Security set on something other than "Anonymous
Authentication."
- Nothing
Happens 1: If you forget to add the IUSR_Computername
account to SQL Server... Server Agent lights will flash
for a few seconds and stop. Then, when you look in your
database... no records! Make sure that your user can access
your database.
- Nothing
Happens 2: From what I have seen - SQL Server CE
RDA does not work through firewall, through proxy's or
similar. There needs to be a clear pipe to the server.
- Runtime
Errors: how many time hav you typed to fas, and
mispeld words? Typing errors can cause some interesting
runtime results. Option Explicit will help you
track some of them down. "Cannot Find Object in Collection"
while going through a recordset is a good one.
Previous Page