Friday, February 29, 2008

Adorable AJAX

We are freshly brewing AJAX into our Java appliction. AJAX is widely used across the web lately. All major google apps like gmail,google maps, google suggest are based on AJAX. In short it makes the server calls seamless to the web user.

Summary of AJAX:




Thursday, February 21, 2008

Leader Vs Manager

For the first time,I heard it from my friend, who wanted to be a leader than a Manager.

It intrigued me.. what is a leader ..? what separates leader from a Manager...? Do we have to be a good manager to be a leader..??

In short the difference is:

Managers are people who do things right and leaders are people who do the right thing.

The difference may be summarized as activities of vision and judgment — effectiveness —versus activities of mastering routines — efficiency. The chart below indicates key words that further make the distinction between the two functions:

· The manager administers; the leader innovates.

· The manager is a copy; the leader is an original.

· The manager maintains; the leader develops.

· The manager accepts reality; the leader investigates it.

· The manager focuses on systems and structure; the leader focuses on people.

· The manager relies on control; the leader inspires trust.

· The manager has a short-range view; the leader has a long-range perspective.

· The manager asks how and when; the leader asks what and why.

· The manager has his or her eye always on the bottom line; the leader has his or her eye on the horizon.

· The manager imitates; the leader originates.

· The manager accepts the status quo; the leader challenges it.

· The manager is the classic good soldier; the leader is his or her own person.

· The manager does things right; the leader does the right thing.

The most dramatic differences between leaders and managers are found at the extremes: poor leaders are despots, while poor managers are bureaucrats in the worst sense of the word. Whilst leadership is a human process and management is a process of resource allocation, both have their place and managers must also perform as leaders. All first-class managers turn out to have quite a lot of leadership ability.


In a different perspective:

here is an article in Hindu News paper by B. S. RAGHAVAN

What are the qualities and capabilities of a leader as distinguished from those of a manager? Is there anything like leadership in and by itself, which differs from what is expected of a manager? Are the functions of the leader and manager distinct and separate?

Management tracts purposely pursue these enquiries. It is a truism that not all leaders are necessarily good managers and vice versa. It is equally clear that high designations alone do not help in delivering the goods. There is a view of Jawaharlal Nehru, for instance, that he was inspiring as a leader but fell short as the chief executive of the nation. Making a distinction between the attributes of a leader and a manager is a pointless pastime. Management pros, however, happily indulge in it. Some write-ups go to absurd lengths in viewing leader's role in isolation from that of the manager. One that I saw recently lets itself go with things like: Leaders inspire, managers measure; leaders guide, managers navigate; leaders talk, managers listen; leaders expect, managers demand; leaders support, managers teach; and similar inanities.

Actually, if a leader is one who inspires his associates to act in tune with his vision by setting an example in all that he expects in and of others, then every functionary who has been given a task to accomplish, whether called a manager or by any other name, has to be a leader as well.

Similarly, it is no use merely entertaining or propagating a vision and having impeccable credentials as a person unless they translate into achievements contributing to the goals of the organisation or the collective good of the society. Thus, the only reliable test of leadership is its ability to produce results commensurate with the efforts.

I think you have to be a good manager to be a good leader. Having the vision alone wont solve the purpose.. you should also know how to deliver effective results. :D

Tuesday, February 19, 2008

Access Database Tips and Tricks

I was supporting this dying application along with my other work on SRGT. Since RGC was dying. they wanted to decomission it and wanted me to develop a small vba application for users to be able to view the data.

grr.. I'll be glad to work in java but VBA is totally new to me.. so I am learning and posting what I learn here

for everyones ref incuding me :D

To show another Form from the current Form
DoCmd.OpenForm "frmEmployeeMain"

Form is accessed by ME
ie., to ref any form variable in access, use ME.


Passing variable from one Form to Another

syntax of accessing: Forms![formname]![fieldname]

Dim strSun As String

strSun = Forms!CustomeSearchForm!customerName

Showing an alert msg.

Alert msgs are great way to debug an app. Here is how to show 1 in access

yourMsg = MsgBox(strSun, 1, strEmpCount)

Creating welcome screen:

1) In your design window... go to tools --> Startup --> select the form / page you want to use for startup

2) You can also choose to hide the database window here.

When you have a welcome screen, press F11 to see the database window instantly


Wild card search with parameters:

uery parameter coming from another form : [Forms]![CustomeSearchForm]![customerName]

TO add wild card search to the above parameter just add "*" & [query params] &"*"

Like "*" & [Forms]![CustomeSearchForm]![customerName] & "*"

Equi Join vs OuterJoin

Instead of using equi join use the outer join to display all the data from table 1 though the
mapping information is missing in the child table or table 2.Just rt click on the join to change the join properties.

avoiding ghostly grey pages with graceful error messages.

Catching errors on page load.

Private Sub Form_Load()
On Error GoTo Err_search_Click

strSun = Me.id_rgc_customer

Exit_search_Click:
Exit Sub

Err_search_Click:

MsgBox "No Search Results Found. Please Refine Your Search."
DoCmd.Close

End Sub

Adding other tips I have learnt on printing and executing queries from access VBA

Close all other forms from an existing Form:
Just refer them by Form Name

DoCmd.Close acForm, "OldFormName"

But there is also an efficient way of doing it. I am just lazy but saw it one of my google searches y'day.

Executing Queries in Access VBA:

Dim db As DAO.Database

When you define your Database variable.. please make sure.. you append it with DAO.I did this stupid mistake of not adding DAO. yesterday and you can see my frustration
in my prev post.

Its just that Access defaults it to ADO and not DAO.. so I kept getting type mis match errors GRRRR.. I knew I passed by the hell y'day. SO DO NOT do the same mistake I did.

So being cautious define all ur Record sets etc.,

Dim db As DAO.Database
Dim facList As DAO.Recordset
Dim sptList As DAO.Recordset
Dim qryPar As DAO.QueryDef
Dim qrySpt As DAO.QueryDef

Next step is setting ur database to current database
Set db = CurrentDb
Set qrySpt = db.QueryDefs("myDefinedQry")


printRGCFacilityQuery is the query you must have defined in ur queries tab already

If your query takes input parameter.. set them here. If ur query expects i/p parms
and if u didnt set them already you will get too few parameters error.

'Set parameters

qrySpt.Parameters(0) = facList!fi_id_facility
qrySpt.Parameters(1) = Me.id_rgc_customer


'Execute Query
Set sptList = qrySpt.OpenRecordset


If (sptList.RecordCount > 0) Then

sptList.MoveFirst

Do Until facList.EOF

'Your Biz Logic goes here

End If
sptList.MoveNext
Loop

'Its always a good practice to close your connections after ur done w/ your processing.
qrySpt.Close
Set qrySpt = Nothing


Printing Other pages from the existing page:
'Open Form
DoCmd.OpenForm "printFacSupportForm", acPreview
'Print Form
DoCmd.RunCommand acCmdPrint
'Close Form
DoCmd.Close acForm, "printFacSupportForm"


'Open the form ur printing from

Me.Form.GoToPage 1



Happy Coding :D
-Sonu