How to set a "randomValue" to a variable and How to run an UPDATE within a Data Base using this variable
'set a random number - this function will be called to do updates
Function RandomNr
upperbound = 1000-1
lowerbound = i
For i=1 to upperbound
Randomize
RndNr = Int((upperbound - lowerbound + 1) * Rnd + lowerbound)
Next
RandomNr = RndNr
End Function
DB Update using the "RandomNr" function above:
updateCol1data = UCASE("update tableName set ColumnHere = '" & RandomNr & "' WHERE columnName='value'")
'querying an 'UPDATE' for a fields within DB
Public Function DBUpdate(updateCol1data)
set conn = createobject("adodb.connection")
End Function
Now to call this function use next:
DBUpdate updateCol1data
'set a random number - this function will be called to do updates
Function RandomNr
upperbound = 1000-1
lowerbound = i
For i=1 to upperbound
Randomize
RndNr = Int((upperbound - lowerbound + 1) * Rnd + lowerbound)
Next
RandomNr = RndNr
End Function
DB Update using the "RandomNr" function above:
updateCol1data = UCASE("update tableName set ColumnHere = '" & RandomNr & "' WHERE columnName='value'")
'querying an 'UPDATE' for a fields within DB
Public Function DBUpdate(updateCol1data)
set conn = createobject("adodb.connection")
conn.open "DSN=DSN_SERVERhere; UserID=userID; Password=password;"
conn.Execute updateCol1dataEnd Function
Now to call this function use next:
DBUpdate updateCol1data
Hello Peterson, as I posted few weeks ago, I am not doing QTP for a long while already. Because of this I am not up to date with the latest news & techniques on QTP (now FTP)... In my last post I was asking people viewing the blog, if there is anyone available and would like to keep updating it, to let me know...
ReplyDeleteSorry...
Thanks for posting QTP samples. I need some more QTP samples to understand technically. Software Testing Course in Chennai is good to study or we want go for seprate QTP Training.
ReplyDeleteHi venki, I wish I add more examples, but I am not in the field now, so unfortunately I cannot do that. Please check http://www.qtpcenter.com/2014/05/need-volunteers-for-posting-qtp-ftp.html page for more details.
DeleteThat was a very informative post. Thank you so much. Keep posting more.
ReplyDeleteRaksha
QTP Training Institutes in Chennai | QTP Training Institutes in Chennai
Technology place a vital part in humans ecosystem. So in order to survive one must be up to date. Thanks for sharing this information in here. Keep blogging article like this. I have bookmarked this page for future reference.
ReplyDeleteHadoop Training Chennai | Best hadoop training institute in chennai | JAVA training in Chennai
Hi, I am really happy to found such a helpful and fascinating post that is written in well manner. Thanks for sharing such an informative post.
ReplyDeleteRegards..
QTP Training in Chennai
Thanks for sharing your ideas on mobile application.Really useful to me.Continue sharing more like this.
ReplyDeleteRegards,
Mobile Application Training in Chennai | Mobile Apps Testing Training | Mobile Application Testing Training