Generally we read titles like "A Day in the life of ....". But well.. this is not any ordinary day.. hence its not "A day" but "The Day" for me today. Today's day is worth a mention. Its past 12 now.. so I should rather say, yesterday is worth a mention.
Also, generally its addressed as QTP Tester, but here I have intentionally written "QTP Programmer". Because, what I feel is - QTP is more about programming the test cases/scenarios, and not testing the test cases/scenarios.
Since a long time, I was trying to connect to mainframe DB2 database from QTP. Earlier I had connected to excel with ADODB in my past scripts. This time, I had taken up a new module, which needed me to connect to the mainframe DB2 database.
I had never done that before. Well there is always a 1st time. But! first times become very difficult and challenging when
1) you are alone in the team trying it out, with no one to discuss
2) there is no one on the complete floor doing even least similar type of work
3) and I better not comment on the willingness of people to help someone
So, coming back to my topic, I started to attempt this thing in the month of Apil... and when I began, I had no clue as to what will be the pre-requisites, and other hows of it. But why worry!... Google zindabad. I wonder what will be the life of a programmer without GOOGLE ;)
I spent a lot of time and efforts on this thing.
After some initial google sessions, chats and calls with our co-developers of global and local team, I was able to gather some useful info. I reached till installing the DB2 client, getting the correct driver and creating a ODBC connection to desired database. With this I could connect to db2 via MS Access (thanks to a co-developer who showed me how I can test my connection in Access.). But when I was trying a DSN less connection via QTP it was erroring out. To get this resolved, I pulled the hell out of everything
- emails to global QTP forum of my company
- email to the COE team of my company
- email to my friends
- postmortumed each and every possible site with GOOGLE
- finally I raised a ticket with the HP Support team itself. With them I had conference calls to US, sent them video recordings of the error, emails to and fro...
I was very close to it ... but didnt know where was some thing going wrong... nor anyone else was able to figure it out.
And!
After a long series of trails and errors, I have finally been able to do what I was trying to. I dont know how but aaj mere dimag ki batti jali... may because after a long time today morning I had a good break from things, as we all team members had gone out for a movie - Pirates of the Carrebean sea, and then for a lunch in Ranjdhani... this might have relaxed my brains...
What I did -
a) I was already being able to connect to the created ODBC System DSN thru MS Access.
b) I was confident to connect to MS Access from QTP, as I had already connected to MS Excel earlier
So... when when a=b, and b=c then, a=c.....
samjha?
meaning,
a) ODBC System DSN connected to the mainframe db2 database
b) MS Access database connected to the ODBC
c) QTP connected to the MS Access database via a DSN less connection.
hehehe, so simple na... yes it was. But this is like a long cut. But still it works and my purpose is server.
Today, I tried the above approach. While doing that also, I had to struggle a bit with getting the right code and setup in place, but that was not tough.
Though the main issue is still pending, of connecting QTP to DB2 directly, I am glad that I found a work around.
I did see that many people on google have been able to connect to mainframe DB2 database thru their QTP code or vb scripting... I didnt get why I was not able to.. and what exactly was the error... but well, if the HP ppl themselves couldn't resolve the error, then why I break my head :) ho na le? maan gaye.. kisse? meri paar ki najar.. aur Nirma super.. dono ko :P
When it worked for the 1st time.. when I saw that connection.state=1... I was not able to belive it.. did it really happen? Had it really got connected? it had...
next when I tried the record set to open, it was asking me for the mainframe user id and pwd. That was not desirable. I had provided it while opening the connection in connection string, but it was not enough...
Later, again I don;t know how, but mera hi dimag chala.. I figured out that these credentials could be stored in the ODBC configuration itself. When I did that, it worked. It stopped prompting for it in the code..
O my god.. is it really working? Let me check the records fetched... O my god.. fields values are coming.. my god..it is finally working...
I ran it 2-3 times, saved the code, documented what I did...
until then, I holded my excitement... and then, on my place I opened up in shocking but exicited voice that finally its working, I am able to connect, I have done it... :) yeeeeeeee
But all my colleagues were in their own world.. well unka bhi dosh nahi hai, they don't work on QTP...
My global and local manager were aware of this challenge, so in this weeks status report I highlighted that I was finally able to worked it out :) I am sure they will atleast undertand though not empathize.
Later, on my another desktop, on where it was not even connecting to MS Access, I uninstalled and reinstalled things, and tried the setups again. Well.. to my surprise, today, it worked over that machine as well. I was shocked. Whats with today. everything has started wrking? WOW.. what is there today..??? wat magic is happening?
With content and happiness, when I was packing and leaving, I heard 2 developers of ours, rejoicing. They called me. They were able to finally fix the defect I had raised in Cycle 0, in IST2 (Cycle 0, IST1 and then comes IST2)... they had been also wrking on it quite hard....I was very happy to know they finally did it. I congratulated them.
I could exactly empathize them... :)
So yesterday was the day of Solutions... not only for me, but for others as well :)
O man.... and important to mention... I had met my school friend ANUPAMA in morning on the Govandi Railway station... I think I met her after more than 10yrs.
Thank you so much GOD... for making my yesterday - THE DAY....
Thanks.
Also, generally its addressed as QTP Tester, but here I have intentionally written "QTP Programmer". Because, what I feel is - QTP is more about programming the test cases/scenarios, and not testing the test cases/scenarios.
Since a long time, I was trying to connect to mainframe DB2 database from QTP. Earlier I had connected to excel with ADODB in my past scripts. This time, I had taken up a new module, which needed me to connect to the mainframe DB2 database.
I had never done that before. Well there is always a 1st time. But! first times become very difficult and challenging when
1) you are alone in the team trying it out, with no one to discuss
2) there is no one on the complete floor doing even least similar type of work
3) and I better not comment on the willingness of people to help someone
So, coming back to my topic, I started to attempt this thing in the month of Apil... and when I began, I had no clue as to what will be the pre-requisites, and other hows of it. But why worry!... Google zindabad. I wonder what will be the life of a programmer without GOOGLE ;)
I spent a lot of time and efforts on this thing.
After some initial google sessions, chats and calls with our co-developers of global and local team, I was able to gather some useful info. I reached till installing the DB2 client, getting the correct driver and creating a ODBC connection to desired database. With this I could connect to db2 via MS Access (thanks to a co-developer who showed me how I can test my connection in Access.). But when I was trying a DSN less connection via QTP it was erroring out. To get this resolved, I pulled the hell out of everything
- emails to global QTP forum of my company
- email to the COE team of my company
- email to my friends
- postmortumed each and every possible site with GOOGLE
- finally I raised a ticket with the HP Support team itself. With them I had conference calls to US, sent them video recordings of the error, emails to and fro...
I was very close to it ... but didnt know where was some thing going wrong... nor anyone else was able to figure it out.
And!
After a long series of trails and errors, I have finally been able to do what I was trying to. I dont know how but aaj mere dimag ki batti jali... may because after a long time today morning I had a good break from things, as we all team members had gone out for a movie - Pirates of the Carrebean sea, and then for a lunch in Ranjdhani... this might have relaxed my brains...
What I did -
a) I was already being able to connect to the created ODBC System DSN thru MS Access.
b) I was confident to connect to MS Access from QTP, as I had already connected to MS Excel earlier
So... when when a=b, and b=c then, a=c.....
samjha?
meaning,
a) ODBC System DSN connected to the mainframe db2 database
b) MS Access database connected to the ODBC
c) QTP connected to the MS Access database via a DSN less connection.
hehehe, so simple na... yes it was. But this is like a long cut. But still it works and my purpose is server.
Today, I tried the above approach. While doing that also, I had to struggle a bit with getting the right code and setup in place, but that was not tough.
Though the main issue is still pending, of connecting QTP to DB2 directly, I am glad that I found a work around.
I did see that many people on google have been able to connect to mainframe DB2 database thru their QTP code or vb scripting... I didnt get why I was not able to.. and what exactly was the error... but well, if the HP ppl themselves couldn't resolve the error, then why I break my head :) ho na le? maan gaye.. kisse? meri paar ki najar.. aur Nirma super.. dono ko :P
When it worked for the 1st time.. when I saw that connection.state=1... I was not able to belive it.. did it really happen? Had it really got connected? it had...
next when I tried the record set to open, it was asking me for the mainframe user id and pwd. That was not desirable. I had provided it while opening the connection in connection string, but it was not enough...
Later, again I don;t know how, but mera hi dimag chala.. I figured out that these credentials could be stored in the ODBC configuration itself. When I did that, it worked. It stopped prompting for it in the code..
O my god.. is it really working? Let me check the records fetched... O my god.. fields values are coming.. my god..it is finally working...
I ran it 2-3 times, saved the code, documented what I did...
until then, I holded my excitement... and then, on my place I opened up in shocking but exicited voice that finally its working, I am able to connect, I have done it... :) yeeeeeeee
But all my colleagues were in their own world.. well unka bhi dosh nahi hai, they don't work on QTP...
My global and local manager were aware of this challenge, so in this weeks status report I highlighted that I was finally able to worked it out :) I am sure they will atleast undertand though not empathize.
Later, on my another desktop, on where it was not even connecting to MS Access, I uninstalled and reinstalled things, and tried the setups again. Well.. to my surprise, today, it worked over that machine as well. I was shocked. Whats with today. everything has started wrking? WOW.. what is there today..??? wat magic is happening?
With content and happiness, when I was packing and leaving, I heard 2 developers of ours, rejoicing. They called me. They were able to finally fix the defect I had raised in Cycle 0, in IST2 (Cycle 0, IST1 and then comes IST2)... they had been also wrking on it quite hard....I was very happy to know they finally did it. I congratulated them.
I could exactly empathize them... :)
So yesterday was the day of Solutions... not only for me, but for others as well :)
O man.... and important to mention... I had met my school friend ANUPAMA in morning on the Govandi Railway station... I think I met her after more than 10yrs.
Thank you so much GOD... for making my yesterday - THE DAY....
Thanks.
well done alpana..finally u got sum inpiration from me..lolz..:P
ReplyDeleteWell said; life of a programmer without google,. congrats for your successful implementation... and keep ding it!!!....BYE & TAKE CARE....
ReplyDeleteIRFAN MIRZA
Hi Aplana,
ReplyDeletefor Database connection with QTP
you need to knwo DSN ,Username and pwd.
set cnn= create object("ADODB.Connection")
cnn.connectionstring = "DSN = 'write DSN Name "
set sl = cnn.Execute("'sql query for ex: SELECT * From Orders")
==========================
For ADODB Connections
Set cnn = CreateObject("ADODB.Connction")
cnn.Provider =("Microsoft.JET.OLEDB.4.0")
cnn.Open = "'Path of the .mdb "
set sl = createObject("ADODB.Recordset")
sl.open "'write uer SQL Query",cnn
And for Oracle Database Connection
ReplyDeleteset cnn = CreateObject("ADODB.Connection")
cnn.open =("Provider=oraOLEDB.oracle.1",UserID= Scott;Password=tiger)
set rc = CreateObject("ADODB.recordset")
rc.open = "'write uer query here",cnn
Hope this was helpfull
Yeah QTP "Programmer" ...
ReplyDeletesome one well said ..
"The true beauty of QTP is that the only limitation is your imagination and ability to code in VBScript."