|
Let me start my answering some basic questions.
Q: Why would I want to create an HTML Form to access my data?
A: Unlike eVB and eVC, JavaScript requires no compiling.
Q: What are the benefits of using HTML/JavaScript?
A: HTML/JavaScript works on all Win CE 3.0 Pocket PC's. Small footprint (size of document and ActiveX creation). No runtime files to load like eVB. You can edit code on your Pocket PC.
Q: How can JavaScript be used to access my data?
A: JavaScript can use ActiveX components, and since ADOCE is an ActiveX component, JavaScript can manipulate data with the same commands as eVB (add,delete,update,next,...).
Q: I don't know JavaScript but want to use HTML/JavaScript to access my data? Where do I start?
A: The first thing you need to do is to create a database with some tables(basic knowledge of how to create a table similar to Access). You can use other programs but I like the one below. Next, you need to download and run DBFormGen to create a form based on a table. This is a vb application that creates HTML and JavaScript code. Now just open up your new HTML file, presto, a data entry form for you new table.
FREE Database Programs. - DBConsole - Create, Edit, Query a Database (FREE), DBFormGen - Creates an HTML/JavaScript Form From a table. I just have to say that I use both of these tools. Great Programs!!!!
Q: How do I tweak my form?
A: If you know JavaScript, then just open your HTML form in your favorite editor. For JavaScript syntax look at Microsoft Scripting Reference Remember that Pocket Internet Explorer(PIE) supports HTML 3.2 standard and client side JavaScript 1.1 with some exceptions. This translates into JScript Version 3 when looking at the Scripting Reference. For more information look at the links provided at the bottom of this page.
Q: What tweaks can be done?
A: I created a table to track my skins. The default form does not order the drop down box. I changed the query to order by name as seen below.

I also changed the form to auto generate a new id for new records (select the record with the greatest number and then add one). I also used the id to locate the correct record to do updates (the default is the drop down data). This lets me change the drop down names without messing up the data. (See below)

Q: Now that my interest is peeked, what else can you do with JavaScript?
A: You can add/delete fields and create or delete indexes. I created an HTML form to do just that. (See below)

A: Since the file control is also an ActiveX control. It is posable to import and export data from a database table. After a little trial and error, I was able to create an HTML form to import and export data (See below). Importing or exporting large data sets this way can be slow, 1000 records can take 20-30 sec (Testing done on a Jornada 548, iPaq's should be faster.)

Note:Speed consideration: HTML forms seem quicker to load then a some eVB programs, but some JavaScript operations could be slower like creating a drop down box. A Drop down box with large amounts of data might seem slow (more than 500 records). To speed up a form, you could change the default form to do a search based on a field. I intend to do this and will post my results soon.
If anyone is interested in my forms you can download my examples I am willing to help people with issues. Just e-mail me or post a question on PocketProjects Pocket PC Web Form. I believe that JavaScript is a viable development environment for the Pocket PC.
I am also available for consulting work to customize an HTML/JavaScript form or create a new customized form/process. If you are interested please e-mail me with your request and contact information (Name, phone,...).
7/26/2001 - More Q/A
Q: What tools are helpful to create applications?
A: I recommend getting the embedded tools from Microsoft. Download or order Microsoft embedded Visual Tools 3.0. The help section on ADOCE is good. I've use other parts of the documentation for exporting data.
Q: How do I debug my code?
A: Don't make mistakes :) Just kidding. It can be difficult because by default the system ignores errors. You can use RegKing to change this(I did not do this) or use Alerts to find where your code is stopping (i.e. Alert('some message'))
Q: How do I pass variables from one page to another.
A: You don't, once you navigate to a new page then your variables are lost. You only need this functionality if you have more than one page for the same table. A work around would be to save the id of the current record in a table when you save your data. When you go to the next page you will need to render the page in code because you can not bind code in the form load. Hint: look at how the drop down is created. The window.document gets passed in the main form section and then the drop down gets rendered. This will have to be done for all fields on the screen. I will post an example of this at some point soon.
Q: How do I compile my code.
A: HTML Code can not be compiled, so anyone can look at your pages just like every website on the internet(I know they don't see everything, but on the PPC they can if they view the htm pages.).
I am creating some JavaScript applications. Here is a look at one of my apps called MyDiary.
|