me,myself,english and programming..

Archive for the ‘AutoIt’ Category

Error handling in AutoIt

Monday, April 5th, 2010

In my post here , I write about connecting to MS-SQL Server. One of my reader/googler ask me about how to handle if let say the password or username are wrong.

Here is the way how to handle it. I think there are another way to do it but personally I find that, this is the easiest way to do it.

 

#include <ie.au3>
_IEErrorHandlerRegister()

$conn = ObjCreate( "ADODB.Connection" )
$DSN = "DRIVER={SQL Server};SERVER=MySvr;DATABASE=MyDB;UID=MyUser;PWD=MyPwd;"
$conn.Open($DSN)
if @Error Then
        MsgBox(0,"Error",$IEComErrorDescription)
Else
        $rs = ObjCreate( "ADODB.RecordSet" )
        $rs.Open( "SELECT @@VERSION AS myVersion", $conn )
        MsgBox(0, "AutoIT-SQL Result", "Value = " & $rs.Fields( "myVersion" ).Value )
EndIf
if IsObj($conn) Then $conn.close

That’s it. Till then..happy coding.

Oh anok anok…

Sunday, December 13th, 2009

enjoy this song..

HR2000 Telekom 8 Digit Converter.

Friday, May 8th, 2009

Previously, I wrote about Automate 7 to 8 digit phone number conversion using AutoIT. Since then, I’m not using it anymore until I get a request regarding phone number conversion from my reader.

Searching that software online bring me no luck, so I ask my friend to email it to me. Now, im here to share the software in case someone need it.

HR Telekom

You can download it here.

p/s: I’m very very busy nowdays….sorry if my response is so slow. :)

Automate your oracle import and export using AutoIt

Wednesday, March 25th, 2009

I always believe that I can do almost everything using AutoIt. Well, since I need to do a lot of import and export job manually, I just wondering why not I just automagically do it using AutoIt.

There are a few steps involve in this process :

1. export data from server to my local pc

2. connect to sqlplus and drop user

3. create user and grant permission

4. import back using dump file created in step 1

Now, here how I convert those steps into AutoIt.

(more…)

How to sound smart, polished and confident

Tuesday, June 17th, 2008

To sound more intelligent

Speak just a bit slower to allow yourself to select the most appropriate words and to give the impression of thoughtfullness.

To sound more powerful

Use short,simple declarative sentences. Say what you mean and mean what you say.Cut out any useless connectors, adjectives,adverbs and superlatives.

To sound more polished

Never answer a question with a blunt “yes” or “no”. Append a short phrase of clarification. For example,”No I did not see that” or “Yes, I know Mary”

(more…)