Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
MySql connection ressource need to be freed ?
#1
Solved: 11 Years, 4 Months ago
Hi,

I ve read the "Database Checkpoint and QTP" blog from Saket, it was really helpful

I would like to know if used ressources (like oConnection = CreateObject("ADODB.Connection") or recordSet) need to be freed (and when/how if needed) ? or if they are auto freed at the end of the test run.


Second point, is there a way to build a connection string with an encrypted password instead of a clear one ? (just to not having readable DB password in multiple places)

regards,
Reply
#2
Solved: 11 Years, 4 Months ago
whenever you create an object, it is always a good practice to free up the allocation used by the object. it depends on the scope of the object you are using in. e.g. the connection object you mentioned would be limited to your work in the part of your script which is related to do with databases otherwise no, so close/free up the object as soon as you finish the things. see the examples given the post.
you can do this by setting the object as Nothing somthing like
Code:
Set oConnection = Nothing

on the second point:
one of the way could be to store the username and password encrypted in the registry.
for more details. this is from coding point of view, but may be you can get an idea from this.
you can also visit http://www.connectionstrings.com/mysql

Reply
#3
Solved: 11 Years, 4 Months ago
thanks for the answer.

it seems that msdn link does not work
Reply
#4
Solved: 11 Years, 4 Months ago
very sorry for that, actually i just did a copy paste there
check this out - http://msdn.microsoft.com/en-us/library/Aa302406

Reply
#5
Solved: 11 Years, 4 Months ago
link works now
thanks you are really very reactive
Reply
#6
Solved: 11 Years, 4 Months ago 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
#7
Solved: 11 Years, 4 Months ago
Priyanaka,
Make it a function. Call it wherever you want to..isint that feasible ?

Defining a DSN is like creating a dependency on that machine. Creating a Connection string on the fly helps you to execute on any machine irrespective of any configuration.
Basanth
Give a fish to a man and you feed him for a day..Teach a man how to fish and you feed him for life.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  [UFT] Connection String for Oracle robertosalemi 6 12,282 01-15-2016, 04:51 PM
Last Post: robertosalemi
  DB2 Connect connection with IE 11 SRP 1 2,619 12-18-2015, 12:41 PM
Last Post: vinod123
  IBM DB2 connection with VB script bmurali 2 10,901 12-18-2015, 12:38 PM
Last Post: vinod123
  Connection with HP ALM hachem 0 2,617 02-26-2015, 04:36 PM
Last Post: hachem
  “Cannot connect to 8822 (connection timed out)" Ikbal 0 2,128 12-08-2014, 11:38 PM
Last Post: Ikbal

Forum Jump:


Users browsing this thread: 6 Guest(s)