Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
DB Connectivity
#1
Not Solved Exclamation 
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
Reply
#2
Not Solved
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
Reply
#3
Not Solved
Hi,

Thanx 4 ur reply...but how to configure this in DSN and how to use this in each and every script?Sad

With Regards,
Priyanka
Reply
#4
Not Solved
Make a function and use dataTable.

Code:
Function DSN()
Dim Oconn
Set OConn = createObject("adodb.connection")
DSN=DataTable["DSN",dtGlobalSheet];Description=desc;UID=Datatable["UserName",dtGlobalSheet];PWD=DataTable["Password",dtGlobalSheet];APP=;WSID=;DATABASE=;"

oConn.Open DSN
End Function
Here I am using Datasheet ,so I don't need to pass DSN,UserName and Password everytime. Everytime I just need to call the function DSN() and it will directly fetch values from the datasheet.

Hope this will help you.Let me know if you have more queries.

~Regrads
Reply
#5
Not Solved
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
Reply
#6
Not Solved Exclamation 
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")]
DBScript=DataTable["DB",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
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Database connectivity error galstar 2 2,603 08-19-2010, 06:04 PM
Last Post: galstar
  Issue related to DB connectivity.. galstar 0 1,692 08-17-2010, 01:07 PM
Last Post: galstar
  How to write a script or database connectivity to connect oracle databse upadhyay40 10 8,516 11-24-2009, 12:37 PM
Last Post: Saket

Forum Jump:


Users browsing this thread: 1 Guest(s)