![]() |
|
DB Connectivity - Printable Version +- Micro Focus QTP (UFT) Forums (https://www.learnqtp.com/forums) +-- Forum: Micro Focus UFT (earlier known as QTP) (https://www.learnqtp.com/forums/Forum-Micro-Focus-UFT-earlier-known-as-QTP) +--- Forum: UFT / QTP Beginners (https://www.learnqtp.com/forums/Forum-UFT-QTP-Beginners) +--- Thread: DB Connectivity (/Thread-DB-Connectivity) |
DB Connectivity - Priyanka Arya - 08-07-2010 Hi, For DB connectivity i have to give full connection string with DSN, username, password, SID etc. like this: ConnectionString = "DSN=QTPDSN;Description=desc;UID=;PWD=;APP=;WSID=;DATABASE=;" but in donot want to give this UID, pwd, WSID in each and every script again again. I want do this setting in DSN and then provide only DSN name in connectingString. Is it possible? Please reply to me ASAP. With Regards, Priyanka RE: DB Connectivity - QTPLearn - 08-09-2010 I have the similar situation and for this I automated 'DSN' creation Process. Before executing any Testsuite or script through automated script I am configuring the DSN and then using the same DSN in all the script. So may be you can also try this approach. ~Regards RE: DB Connectivity - Priyanka Arya - 08-09-2010 Hi, Thanx 4 ur reply...but how to configure this in DSN and how to use this in each and every script? ![]() With Regards, Priyanka RE: DB Connectivity - QTPLearn - 08-09-2010 Make a function and use dataTable. Code: Function DSN()Hope this will help you.Let me know if you have more queries. ~Regrads RE: DB Connectivity - Priyanka Arya - 08-10-2010 Hi, Thanx 4 ur reply...i have to give DSN in each and every script becuase d/b mapping is done by this. I want use different WSID's and d/b in different scripts so i don't have any issue in UID,pwd and other parametrs beacuse i can configure these in DSN. Please reply for WSID and database..so that i cananot mention WSID and d/b each and every script. With Regards, Priyanka RE: DB Connectivity - QTPLearn - 08-10-2010 If you need to change WSID and d/b each and every script then use Local Sheet(Action Specific Sheet) and Enviornment Variable. Code: WSID =DataTable["WSID",Enviornment.Value("ActionName")]Updated the DSN function which I posted in previous reply with these two values. Only thing is that for each script you have to maintain the WSID and DBScript columns in Specific Action Sheets i.e Action1,Action2..) Do let me know if anything is wrong or not clear. ~Regards |