Monday, April 30, 2012

Telling a Mobile Story

You may have seen my review of "The Back of the Napkin". The book is all about using pictures and visual thinking to solve problems and sell ideas. I enjoyed the book so I thought I would try to incorporate some drawing into some of my presentations. I drew a picture as I was describing why mobility is important in today’s business world. The final drawing is shown below.

MobileStory_thumb[1]

Although every picture tells a story sometimes a few words help. In this case we start on the right with the extremely large computer, I believe I drew a TRS80 here, connected to a database in a client/server model. The person on the far left is a physician who is working with a patient and documenting what is being done.

The middle of the diagram shows the various ways the doctor’s work can be recorded. The orange path shows the traditional paper route the doctor writes down the diagnosis and treatment then gives the paper to the billing person for entry into the system. The yellow path represents the doctor recording the information electronically but having to print the result out to once again give to the billing person. Finally the blue path shows the data going directly to the database allowing for more accuracy and allowing the billing person to interact with patients instead of just doing data entry.

I used this story to introduce the need for mobility solutions for common applications. With the Advantage Web Platform data can now be sent and received from virtually any mobile device. Now the physician can enter information about a patient while visiting them at the hospital and the relevant information can be sent directly to the billing system at the office.

This scenario can be used in all types of industries. Perhaps you manage documents and need to allow access on a tablet. Maybe you support an industry like construction or landscaping where providing an on-site quote can win you the business. The possibilities are endless.

Even with my meager drawing skills the picture seemed to resonate with the group. I think it was relatively effective in conveying my point. If you attend any of my upcoming presentations you may just see some drawing to go along with the slides.

The Advantage Web Platform is available as part of the Advantage 11 Beta which you can download now.

Friday, April 27, 2012

Unicode Usernames and Passwords

Advantage added support for Unicode in version 10. I did a few posts and a demo of this feature in 2009, just put Unicode in the search box to find relevant posts. However, Data Dictionary metadata is still stored in Character fields.
This means that usernames and passwords cannot be stored as Unicode by default. In order to use Unicode usernames and passwords you will need to convert the characters to UTF8 before storing them in the dictionary.
For Delphi 2009 and newer these Unicode strings are stored using UTF16, the default for Windows systems. These UTF16 values need to be converted to UTF8 before storing them in the data dictionary. An example of creating a user with Unicode is shown below.

procedure TForm1.btnCreateUser(Sender: TObject);
var
  FhConnection   : AdsNativeInt;
  RetVal         : Cardinal;
begin
  //First make an admin connection
  RetVal := ace.AdsConnect60('C:\Data\TestDb\TestDb.add', ADS_REMOTE_SERVER,
                   'adssys', 'password', ADS_DEFAULT, @FhConnection );

  if ( RetVal = AE_SUCCESS ) then
  begin
    // Create the user using the values from edit boxes
    RetVal := ace.AdsDDCreateUser(lHandle, nil, 
                      PAnsiChar( UTF8String( edtUsername.Text ) ),
                      PAnsiChar( UTF8String( edtPassword.Text ) ), 
                      'Unicode username and password' ) ;
    // add error checking here
  end
  else
    showmessage( 'Connection Failed: ' + IntToStr(RetVal));
end;
Once the user has been created you can then connect using the same type of casting.
procedure TForm1.btnLoginClick(Sender: TObject);
var
  FhConnection   : AdsNativeInt;
  RetVal         : Cardinal;
begin
  // Connect using the supplied username and password
  RetVal := ace.AdsConnect60('C:\Data\TestDb\TestDb.add', ADS_REMOTE_SERVER,
                   PAnsiChar( UTF8String( edtUsername.Text ) ),
                   PAnsiChar( UTF8String( edtPassword.Text ) ),
                   ADS_DEFAULT, @FhConnection );

  if ( RetVal = AE_SUCCESS ) then
    showmessage( 'Connection Successful!' );
  else
    showmessage( 'Connection Failed: ' + IntToStr(RetVal));
end;

You can do similar conversions in other languages as well. If you need code for a specific language let me know and I'll get some additional examples posted.

Monday, April 23, 2012

LAFox User Group

I will be traveling down to Los Angeles this week to present at the LAFox User group Meeting. The meeting is on Wednesday April 25th at 7:30 PM. The meeting is held in Councilman Bill Rosendahl’s Westchester Office: 7166 West Manchester Ave. 90045 see the map below.

I will be discussing mobilizing your application using Advantage Database Server and our new Web Platform. I will be doing demonstrations using the beta version of Advantage 11, so this is your first chance to see the latest release of Advantage. You can get more details about the meeting by visiting the LAFox Homepage.