<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/atom10full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><feed xmlns="http://www.w3.org/2005/Atom" xmlns:openSearch="http://a9.com/-/spec/opensearch/1.1/" xmlns:georss="http://www.georss.org/georss" xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr="http://purl.org/syndication/thread/1.0" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" gd:etag="W/&quot;CkACRn07eyp7ImA9WhRXF0k.&quot;"><id>tag:blogger.com,1999:blog-5626494138934609795</id><updated>2011-12-24T07:32:47.303-08:00</updated><category term="test case" /><category term="for loop" /><category term="visual basic" /><category term="bugs" /><category term="search engine" /><category term="scripting language" /><category term="database queries" /><category term="vb script basics" /><category term="DCL in sql" /><category term="phases in sdlc" /><category term="functions" /><category term="branching statements" /><category term="VB Script operators" /><category term="vb functions" /><category term="data definiton language" /><category term="info on andhra pradesh" /><category term="testing questions" /><category term="queries" /><category term="sql command list" /><category term="Switch Case" /><category term="VB Constants" /><category term="variables declaration" /><category term="database interview questions" /><category term="data control language" /><category term="db testing" /><category term="sql commands reference" /><category term="sql commands DDL" /><category term="variables" /><category term="Visual Basic Scripting" /><category term="good test case" /><category term="VBScript operators" /><category term="scripting" /><category term="VBScript Reference" /><category term="sdlc" /><category term="if else" /><category term="QA" /><category term="trail version" /><category term="Testing in sdlc" /><category term="UI Designers" /><category term="software errors" /><category term="Vb script" /><category term="andhra pradesh" /><category term="andhra spider" /><category term="vb scripting" /><category term="database testing" /><category term="SQL Commands" /><category term="DML" /><category term="sql queries" /><category term="quality standards" /><category term="sql" /><category term="coding" /><category term="search" /><category term="phases" /><category term="quality" /><category term="extend trail version" /><category term="testing interview qestions" /><category term="sotware testing" /><category term="software development life cycle" /><category term="testing" /><category term="Usability Features" /><category term="transaction control language" /><category term="TCL" /><category term="data manipulation language" /><category term="Testing in software development" /><title>A Tester's Blog</title><subtitle type="html">This is for all those who want to learn and contribute to software Testing</subtitle><link rel="http://schemas.google.com/g/2005#feed" type="application/atom+xml" href="http://kiranqa.blogspot.com/feeds/posts/default" /><link rel="alternate" type="text/html" href="http://kiranqa.blogspot.com/" /><link rel="next" type="application/atom+xml" href="http://www.blogger.com/feeds/5626494138934609795/posts/default?start-index=26&amp;max-results=25&amp;redirect=false&amp;v=2" /><author><name>Kanikaram Kiranpaul</name><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><generator version="7.00" uri="http://www.blogger.com">Blogger</generator><openSearch:totalResults>76</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/atom+xml" href="http://feeds.feedburner.com/ATestersBlog" /><feedburner:info uri="atestersblog" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><entry gd:etag="W/&quot;DkYMSXY5eip7ImA9WxFVFk0.&quot;"><id>tag:blogger.com,1999:blog-5626494138934609795.post-148297409975099060</id><published>2010-06-15T05:12:00.000-07:00</published><updated>2010-06-15T05:16:28.822-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-06-15T05:16:28.822-07:00</app:edited><title>Database Testing - SQL - Sub-Query Operators: (ALL,ANY,SOME,EXISTS)</title><content type="html">&lt;span style="font-weight: bold;"&gt;Sub-Query operators: (ALL,ANY,SOME,EXISTS)&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;div style="text-align: justify;"&gt;&lt;span style="font-weight: bold;"&gt;43. List out the employees who earn more than every employee in department 30.&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;h5 style="font-weight: normal; color: rgb(153, 0, 0); text-align: justify;" class="myclass"&gt;&lt;span style="font-size:100%;"&gt;Select * from employee where salary &gt; (Select Max(salary) from employee where department_id=30)&lt;/span&gt;&lt;/h5&gt;&lt;br /&gt;&lt;div style="text-align: justify;"&gt;&lt;span style="font-weight: bold;"&gt;44. List out the employees who earn more than the lowest salary in department 30.&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;h5 style="font-weight: normal; text-align: justify; color: rgb(153, 0, 0);" class="myclass"&gt;&lt;span style="font-size:100%;"&gt;Select * from employee where salary &gt; (Select min(salary) from employee where department_id=30)&lt;/span&gt;&lt;/h5&gt;&lt;br /&gt;&lt;div style="text-align: justify;"&gt;&lt;span style="font-weight: bold;"&gt;45. Find out whose department has no employees.&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;h5 style="font-weight: normal; color: rgb(153, 0, 0); text-align: justify;" class="myclass"&gt;&lt;span style="font-size:100%;"&gt;Select * from department d where not exists (Select department_id from employee e where d.department_id=e.department_id)&lt;/span&gt;&lt;/h5&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;By Using Joins&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;h5 style="color: rgb(153, 0, 0); text-align: justify; font-weight: normal;" class="myclass"&gt;&lt;span style="font-size:100%;"&gt;select employee_id, d.department_id, Name, Location_id from employee e  right join department d on d.department_id=e.department_id where e.employee_id is null and  d.department_id is not null&lt;/span&gt;&lt;/h5&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;46. Find out which department does not have any employees.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;h5 style="font-weight: normal; color: rgb(153, 0, 0); text-align: justify;" class="myclass"&gt;&lt;span style="font-size:100%;"&gt;Select * from department d where not exists (Select department_id from employee e where d.department_id=e.department_id)&lt;/span&gt;&lt;/h5&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Co-Related Sub Queries:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;div style="text-align: justify;"&gt;&lt;span style="font-weight: bold;"&gt;47. Find out the employees who earn greater than the average salary for their department.&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;h5 style="font-weight: normal; color: rgb(153, 0, 0); text-align: justify;" class="myclass"&gt;&lt;span style="font-size:100%;"&gt;Select employee_id, last_name, salary, department_id from employee e where salary &gt; (select avg(salary) from employee where department_id=e.department_id)&lt;/span&gt;&lt;/h5&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5626494138934609795-148297409975099060?l=kiranqa.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/EwpK3hcJ-T_IgzI6O2PCdNmi_Mk/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/EwpK3hcJ-T_IgzI6O2PCdNmi_Mk/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/EwpK3hcJ-T_IgzI6O2PCdNmi_Mk/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/EwpK3hcJ-T_IgzI6O2PCdNmi_Mk/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/ATestersBlog/~4/_Apg7SzIuhQ" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://kiranqa.blogspot.com/feeds/148297409975099060/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://kiranqa.blogspot.com/2010/06/database-testing-sql-sub-query.html#comment-form" title="1 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/5626494138934609795/posts/default/148297409975099060?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/5626494138934609795/posts/default/148297409975099060?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/ATestersBlog/~3/_Apg7SzIuhQ/database-testing-sql-sub-query.html" title="Database Testing - SQL - Sub-Query Operators: (ALL,ANY,SOME,EXISTS)" /><author><name>Kanikaram Kiranpaul</name><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>1</thr:total><feedburner:origLink>http://kiranqa.blogspot.com/2010/06/database-testing-sql-sub-query.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CEMEQHs7fSp7ImA9WxFVFk0.&quot;"><id>tag:blogger.com,1999:blog-5626494138934609795.post-4149649910498679716</id><published>2010-06-15T04:39:00.000-07:00</published><updated>2010-06-15T04:46:41.505-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-06-15T04:46:41.505-07:00</app:edited><title>Database Testing - SQL - Sub Queries Examples</title><content type="html">&lt;span style="font-weight: bold;"&gt;Sub-Queries&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;div style="text-align: justify;"&gt;&lt;span style="font-weight: bold;"&gt;34. Display the employee who got the maximum salary.&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;h5 style="font-weight: normal; color: rgb(153, 0, 0); text-align: justify;" class="myclass"&gt;&lt;span style="font-size:100%;"&gt;Select * from employee where salary=(select max(salary) from employee)&lt;/span&gt;&lt;/h5&gt;&lt;br /&gt;&lt;div style="text-align: justify;"&gt;&lt;span style="font-weight: bold;"&gt;35. Display the employees who are working in Sales department&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;h5 style="font-weight: normal; color: rgb(153, 0, 0); text-align: justify;" class="myclass"&gt;&lt;span style="font-size:100%;"&gt;Select * from employee where department_id = (select department_id from department where name='SALES')&lt;/span&gt;&lt;/h5&gt;&lt;br /&gt;&lt;div style="text-align: justify;"&gt;&lt;span style="font-weight: bold;"&gt;36. Display the employees who are working as "Clerk".&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;h5 style="text-align: justify; font-weight: normal; color: rgb(153, 0, 0);" class="myclass"&gt;&lt;span style="font-size:100%;"&gt;Select * from employee where job_id in (select job_id from job where function1='CLERK')&lt;/span&gt;&lt;/h5&gt;&lt;br /&gt;&lt;div style="text-align: justify;"&gt;&lt;span style="font-weight: bold;"&gt;37. Display the employees who are working in "Boston"&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;h5 style="text-align: justify; color: rgb(153, 0, 0); font-weight: normal;" class="myclass"&gt;&lt;span style="font-size:100%;"&gt;Select * from employee where department_id=(select department_id from department where location_id=(select location_id from location where regional_group='Boston'))&lt;/span&gt;&lt;/h5&gt;&lt;br /&gt;&lt;div style="text-align: justify;"&gt;&lt;span style="font-weight: bold;"&gt;38. Find out no.of employees working in 'Sales" department.&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;h5 style="font-weight: normal; color: rgb(153, 0, 0);" class="myclass"&gt;&lt;span style="font-size:100%;"&gt;Select * from employee where department_id=(select department_id from department where name='SALES' group by department_id)&lt;/span&gt;&lt;/h5&gt;&lt;br /&gt;&lt;div style="text-align: justify;"&gt;&lt;span style="font-weight: bold;"&gt;39. Update the employees salaries, who are working as Clerk on the basis of 10%.&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;h5 style="font-weight: normal; color: rgb(153, 0, 0); text-align: justify;" class="myclass"&gt;&lt;span style="font-size:100%;"&gt;Update employee set salary=(salary*10/100) where job_id=(select job_id from job where function1='CLERK')&lt;/span&gt;&lt;/h5&gt;&lt;br /&gt;&lt;div style="text-align: justify;"&gt;&lt;span style="font-weight: bold;"&gt;40. Delete the employees who are working in accounting department.&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;h5 style="font-weight: normal; color: rgb(153, 0, 0); text-align: justify;" class="myclass"&gt;&lt;span style="font-size:100%;"&gt;delete from employee where department_id=(select department_id from department where name='ACCOUNTING')&lt;/span&gt;&lt;/h5&gt;&lt;br /&gt;&lt;div style="text-align: justify;"&gt;&lt;span style="font-weight: bold;"&gt;41. Display the second highest salary drawing employee details.&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;h5 style="font-weight: normal; color: rgb(153, 0, 0); text-align: justify;" class="myclass"&gt;&lt;span style="font-size:100%;"&gt;Select * from employee where salary=(select max(salary) from employee where salary &lt;(select max(salary) from employee))&lt;/span&gt;&lt;/h5&gt;&lt;br /&gt;&lt;div style="text-align: justify;"&gt;&lt;span style="font-weight: bold;"&gt;42. Display the 3rd highest salary drawing employee details&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;h5 style="font-weight: normal; color: rgb(153, 0, 0); text-align: justify;" class="myclass"&gt;&lt;span style="font-size:100%;"&gt;Select * from employee a where 3 = (select COUNT(distinct(salary)) from employee b where b.salary &gt;=a.salary)&lt;/span&gt;&lt;/h5&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5626494138934609795-4149649910498679716?l=kiranqa.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/Eqf6nCEmkaQ0Sk3TChDKeVyUi9A/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/Eqf6nCEmkaQ0Sk3TChDKeVyUi9A/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/Eqf6nCEmkaQ0Sk3TChDKeVyUi9A/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/Eqf6nCEmkaQ0Sk3TChDKeVyUi9A/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/ATestersBlog/~4/0At12OnZdpM" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://kiranqa.blogspot.com/feeds/4149649910498679716/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://kiranqa.blogspot.com/2010/06/database-testing-sql-sub-queries.html#comment-form" title="1 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/5626494138934609795/posts/default/4149649910498679716?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/5626494138934609795/posts/default/4149649910498679716?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/ATestersBlog/~3/0At12OnZdpM/database-testing-sql-sub-queries.html" title="Database Testing - SQL - Sub Queries Examples" /><author><name>Kanikaram Kiranpaul</name><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>1</thr:total><feedburner:origLink>http://kiranqa.blogspot.com/2010/06/database-testing-sql-sub-queries.html</feedburner:origLink></entry><entry gd:etag="W/&quot;C0QDQ3g8fCp7ImA9WxFVFk0.&quot;"><id>tag:blogger.com,1999:blog-5626494138934609795.post-4888256694257294833</id><published>2010-06-15T04:12:00.000-07:00</published><updated>2010-06-15T04:29:32.674-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-06-15T04:29:32.674-07:00</app:edited><title>Database Testing - SQL - Group By &amp; Having Clause Examples</title><content type="html">&lt;span style="font-weight: bold;"&gt;Group By &amp;amp; Having Clause:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;div style="text-align: justify;"&gt;&lt;span style="font-weight: bold;"&gt;22. How many employees who are working in different departments wise in the organization&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;h5 style="font-weight: normal; color: rgb(153, 0, 0); text-align: justify;" class="myclass"&gt;&lt;span style="font-size:100%;"&gt;Select department_id, count(*), from employee group by department_id&lt;/span&gt;&lt;/h5&gt;&lt;br /&gt;&lt;div style="text-align: justify;"&gt;&lt;span style="font-weight: bold;"&gt;23. List out the department wise maximum salary, minimum salary, average salary of the employees&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;h5 style="font-weight: normal; color: rgb(153, 0, 0); text-align: justify;" class="myclass"&gt;&lt;span style="font-size:100%;"&gt;Select department_id, count(*), max(salary), min(salary), avg(salary) from employee group by department_id&lt;/span&gt;&lt;/h5&gt;&lt;br /&gt;&lt;div style="text-align: justify;"&gt;&lt;span style="font-weight: bold;"&gt;24. List out the job wise maximum salary, minimum salary, average salaries of the employees.&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;h5 style="font-weight: normal; color: rgb(153, 0, 0);" class="myclass"&gt;&lt;span style="font-size:100%;"&gt;Select job_id, count(*), max(salary), min(salary), avg(salary) from employee group by job_id&lt;/span&gt;&lt;/h5&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;25. List out no. of employees joined in every month in ascending order&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;h5 style="font-weight: normal; color: rgb(153, 0, 0);" class="myclass"&gt;&lt;span style="font-size:100%;"&gt;Select datepart(month, hiredate) 'Month' , count(*) 'No of Employees' from employee group by datepart(month, hiredate) order by datepart(month, hiredate)&lt;/span&gt;&lt;/h5&gt;&lt;br /&gt;&lt;div style="text-align: justify;"&gt;&lt;span style="font-weight: bold;"&gt;26. List out the no.of employees for each month and year, in the ascending order based on the year, month.&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;h5 style="font-weight: normal; color: rgb(153, 0, 0); text-align: justify;" class="myclass"&gt;&lt;span style="font-size:100%;"&gt;Select datepart(Year, hiredate) 'Year', datepart(month, hiredate) 'month', count(*) 'No of employees' from employee group by datepart(year, hiredate), datepart(month, hiredate)&lt;/span&gt;&lt;/h5&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;27. List out the department id having atleast four employees.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;h5 style="font-weight: normal; color: rgb(153, 0, 0); text-align: justify;" class="myclass"&gt;&lt;span style="font-size:100%;"&gt;Select department_id, count(*) 'no of employees' from employee group by department_id having count(*)&gt;=4&lt;/span&gt;&lt;/h5&gt;&lt;br /&gt;&lt;div style="text-align: justify;"&gt;&lt;span style="font-weight: bold;"&gt;28. How many employees in January month.&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;h5 style="font-weight: normal; color: rgb(153, 0, 0);" class="myclass"&gt;&lt;span style="font-size:100%;"&gt;Select datepart(month, hiredate) 'month', count(*) 'no of employees' from employee group by datepart(month, hiredate) having datepart(month, hiredate)=1 --here 1 refers to January &lt;/span&gt;&lt;/h5&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;29. How many employees who are joined in February or August month.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;h5 style="font-weight: normal; color: rgb(153, 0, 0); text-align: justify;" class="myclass"&gt;&lt;span style="font-size:100%;"&gt;Select datepart(month, hiredate) 'month', count(*) 'No of Employees' from employee group by datepart(month, hiredate) having datepart(month, hiredate) in (2,8)&lt;/span&gt;&lt;/h5&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;30. How many employees who are joined in 1985.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;h5 style="font-weight: normal; color: rgb(153, 0, 0);" class="myclass"&gt;&lt;span style="font-size:100%;"&gt;Select datepart(Year, hiredate) 'Year', count(*) 'No of Employees' from employee group by datepart(Year, hiredate)having datepart(Year, hiredate) =1985&lt;/span&gt;&lt;/h5&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;31. How many employees joined each month in 1985.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;h5 style="font-weight: normal; color: rgb(153, 0, 0); text-align: justify;" class="myclass"&gt;&lt;span style="font-size:100%;"&gt;Select datepart(year,hiredate )'Year', datepart(month, hiredate) 'Month', count(*) 'No of employees' from employee where datepart(year, hiredate)=1985 group by datepart(year, hiredate),datepart(month, hiredate)&lt;/span&gt;&lt;/h5&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;32. How many employees who are joined in May 1985.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;h5 style="color: rgb(153, 0, 0); font-weight: normal; text-align: justify;" class="myclass"&gt;&lt;span style="font-size:100%;"&gt;Select datepart(Year, hiredate) 'Year', datepart(Month, hiredate) 'Month', count(*) 'No of employees' from employee where datepart(Year, hiredate)=1985 and datepart(month, hiredate)=5 group by datepart(Year, hiredate),datepart(Month, hiredate)&lt;/span&gt;&lt;/h5&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;33. Which is the department id, having less than or equal to 3 employees joined in April 1985.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;h5 style="font-weight: normal; color: rgb(153, 0, 0);" class="myclass"&gt;&lt;span style="font-size:100%;"&gt;Select department_id, count(*) 'No. of employees' from employee where datepart(Year, hiredate)=1985 and datepart(Month, hiredate) = 4 group by datepart(Year, hiredate), datepart(Month, hiredate), department_id having count(*)&lt;=3&lt;/span&gt;&lt;/h5&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5626494138934609795-4888256694257294833?l=kiranqa.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/AQKdxkPTKUPl6FcTZpUAjTGdv1A/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/AQKdxkPTKUPl6FcTZpUAjTGdv1A/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/AQKdxkPTKUPl6FcTZpUAjTGdv1A/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/AQKdxkPTKUPl6FcTZpUAjTGdv1A/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/ATestersBlog/~4/kdxCyUmOym4" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://kiranqa.blogspot.com/feeds/4888256694257294833/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://kiranqa.blogspot.com/2010/06/database-testing-sql-group-by-having.html#comment-form" title="2 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/5626494138934609795/posts/default/4888256694257294833?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/5626494138934609795/posts/default/4888256694257294833?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/ATestersBlog/~3/kdxCyUmOym4/database-testing-sql-group-by-having.html" title="Database Testing - SQL - Group By &amp; Having Clause Examples" /><author><name>Kanikaram Kiranpaul</name><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>2</thr:total><feedburner:origLink>http://kiranqa.blogspot.com/2010/06/database-testing-sql-group-by-having.html</feedburner:origLink></entry><entry gd:etag="W/&quot;AkEGSXg_fCp7ImA9WxFVFUQ.&quot;"><id>tag:blogger.com,1999:blog-5626494138934609795.post-978428219350793301</id><published>2010-06-15T03:41:00.000-07:00</published><updated>2010-06-15T03:43:48.644-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-06-15T03:43:48.644-07:00</app:edited><title>Database Testing - SQL - Order by clause</title><content type="html">&lt;span style="font-weight: bold;"&gt;Order By Clause:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;div style="text-align: justify;"&gt;&lt;span style="font-weight: bold;"&gt;18. List out the employee id, last name in ascending order based on the employee id.&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;h5 style="font-weight: normal; color: rgb(153, 0, 0);" class="myclass"&gt;&lt;span style="font-size:100%;"&gt;Select employee_id, last_name from employee order by employee_id&lt;/span&gt;&lt;/h5&gt;&lt;br /&gt;&lt;div style="text-align: justify;"&gt;&lt;span style="font-weight: bold;"&gt;19. List out the employee id, name in descending order based on salary column&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;h5 style="font-weight: normal; color: rgb(153, 0, 0);" class="myclass"&gt;&lt;span style="font-size:100%;"&gt;Select employee_id, last_name, salary from employee order by salary desc&lt;/span&gt;&lt;/h5&gt;&lt;br /&gt;&lt;div style="text-align: justify;"&gt;&lt;span style="font-weight: bold;"&gt;20. list out the employee details according to their last_name in ascending order and salaries in descending order&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;h5 style="color: rgb(153, 0, 0); font-weight: normal; text-align: justify;" class="myclass"&gt;&lt;span style="font-size:100%;"&gt;Select employee_id, last_name, salary from employee order by last_name, salary desc&lt;/span&gt;&lt;/h5&gt;&lt;br /&gt;&lt;div style="text-align: justify;"&gt;&lt;span style="font-weight: bold;"&gt;21. list out the employee details according to their last_name in ascending order and then on department_id in descending order.&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;h5 style="text-align: justify; color: rgb(153, 0, 0); font-weight: normal;" class="myclass"&gt;&lt;span style="font-size:100%;"&gt;Select employee_id, last_name, salary from employee order by last_name, department_id desc&lt;/span&gt;&lt;/h5&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5626494138934609795-978428219350793301?l=kiranqa.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/vdodvZB10MyGdlMDQ5BckMBdg4w/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/vdodvZB10MyGdlMDQ5BckMBdg4w/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/vdodvZB10MyGdlMDQ5BckMBdg4w/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/vdodvZB10MyGdlMDQ5BckMBdg4w/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/ATestersBlog/~4/l_q0jJCRYDY" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://kiranqa.blogspot.com/feeds/978428219350793301/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://kiranqa.blogspot.com/2010/06/database-testing-sql-order-by-clause.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/5626494138934609795/posts/default/978428219350793301?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/5626494138934609795/posts/default/978428219350793301?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/ATestersBlog/~3/l_q0jJCRYDY/database-testing-sql-order-by-clause.html" title="Database Testing - SQL - Order by clause" /><author><name>Kanikaram Kiranpaul</name><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>0</thr:total><feedburner:origLink>http://kiranqa.blogspot.com/2010/06/database-testing-sql-order-by-clause.html</feedburner:origLink></entry><entry gd:etag="W/&quot;AkQHQno5fyp7ImA9WxFVFUQ.&quot;"><id>tag:blogger.com,1999:blog-5626494138934609795.post-2862652283650079791</id><published>2010-06-15T03:29:00.000-07:00</published><updated>2010-06-15T03:38:53.427-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-06-15T03:38:53.427-07:00</app:edited><title>Database Testing - SQL- Where Condition Examples</title><content type="html">&lt;span style="font-weight: bold;"&gt;Where Conditions:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;8. List the details about "SMITH"&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;h5 style="font-weight: normal; color: rgb(102, 0, 0);" class="myclass"&gt;&lt;span style="font-size:100%;"&gt;Select * from employee where last_name='SMITH';&lt;/span&gt;&lt;/h5&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;9. List out the employees who are working in department 20&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;h5 style="color: rgb(102, 0, 0); font-weight: normal;" class="myclass"&gt;&lt;span style="font-size:100%;"&gt;Select * from employee where department_id=20&lt;/span&gt;&lt;/h5&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;10. List out the employees who are earning salary between 3000 and 4500&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;h5 style="font-weight: normal; color: rgb(102, 0, 0);" class="myclass"&gt;&lt;span style="font-size:100%;"&gt;Select * from employee where salary between 3000 and 4500&lt;/span&gt;&lt;/h5&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;11. List out the employees who are working in department 10 or 20&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;h5 style="font-weight: normal; color: rgb(102, 0, 0);" class="myclass"&gt;&lt;span style="font-size:100%;"&gt;Select * from employee where department_id in (10,20)&lt;/span&gt;&lt;/h5&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;12. Find out the employees who are not working in department 10 or 30&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;h5 style="font-weight: normal; color: rgb(102, 0, 0);" class="myclass"&gt;&lt;span style="font-size:100%;"&gt;Select last_name, salary, commission, department_id from employee where department_id not in (10,30)&lt;/span&gt;&lt;/h5&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;13. List out the employees whose name starts with "S"&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;h5 style="font-weight: normal; color: rgb(102, 0, 0);" class="myclass"&gt;&lt;span style="font-size:100%;"&gt;Select * from employee where last_name like 'S%'&lt;/span&gt;&lt;/h5&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;14. List out the employees whose name start with "S" and end with "H"&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;h5 style="font-weight: normal; color: rgb(102, 0, 0);" class="myclass"&gt;&lt;span style="font-size:100%;"&gt;Select * from employee where last_name like 'S%H'&lt;/span&gt;&lt;/h5&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;15. List out the employees whose name length is 4 and start with "S"&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;h5 style="font-weight: normal; color: rgb(102, 0, 0);" class="myclass"&gt;&lt;span style="font-size:100%;"&gt;Select * from employee where last_name like 'S___'&lt;/span&gt;&lt;/h5&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;16. List out the employees who are working in department 10 and draw the salaries more than 3500&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;h5 style="font-weight: normal; color: rgb(102, 0, 0);" class="myclass"&gt;&lt;span style="font-size:100%;"&gt;Select * from employee where department_id=10 and salary&gt;3500&lt;/span&gt;&lt;/h5&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;17. list out the employees who are not receiving commission.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;h5 style="font-weight: normal; color: rgb(102, 0, 0);" class="myclass"&gt;&lt;span style="font-size:100%;"&gt;Select * from employee where commission is Null&lt;/span&gt;&lt;/h5&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5626494138934609795-2862652283650079791?l=kiranqa.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/_Knomtnp4mclsoa4tnN4BCqrJe4/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/_Knomtnp4mclsoa4tnN4BCqrJe4/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/_Knomtnp4mclsoa4tnN4BCqrJe4/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/_Knomtnp4mclsoa4tnN4BCqrJe4/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/ATestersBlog/~4/gAPv0I8hRmQ" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://kiranqa.blogspot.com/feeds/2862652283650079791/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://kiranqa.blogspot.com/2010/06/database-testing-sql-where-condition.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/5626494138934609795/posts/default/2862652283650079791?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/5626494138934609795/posts/default/2862652283650079791?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/ATestersBlog/~3/gAPv0I8hRmQ/database-testing-sql-where-condition.html" title="Database Testing - SQL- Where Condition Examples" /><author><name>Kanikaram Kiranpaul</name><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>0</thr:total><feedburner:origLink>http://kiranqa.blogspot.com/2010/06/database-testing-sql-where-condition.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DUAMQX08eyp7ImA9WxFVFUQ.&quot;"><id>tag:blogger.com,1999:blog-5626494138934609795.post-7653026672738346763</id><published>2010-06-15T03:24:00.000-07:00</published><updated>2010-06-15T03:29:40.373-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-06-15T03:29:40.373-07:00</app:edited><title>Database Testing - SQL - Simple Queries Examples</title><content type="html">&lt;span style="font-weight: bold;"&gt;Simple Queries:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;1. List all the employee details&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;h5 style="font-weight: normal; color: rgb(102, 0, 0);" class="myclass"&gt;&lt;span style="font-size:100%;"&gt;Select * from employee;&lt;/span&gt;&lt;/h5&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;2. List all the department details&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;h5 style="font-weight: normal; color: rgb(102, 0, 0);" class="myclass"&gt;&lt;span style="font-size:100%;"&gt;Select * from department;&lt;/span&gt;&lt;/h5&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;3. List all job details&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;h5 style="font-weight: normal; color: rgb(102, 0, 0);" class="myclass"&gt;&lt;span style="font-size:100%;"&gt;Select * from job;&lt;/span&gt;&lt;/h5&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;4. List all the locations&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;h5 style="font-weight: normal; color: rgb(102, 0, 0);" class="myclass"&gt;&lt;span style="font-size:100%;"&gt;Select * from location;&lt;/span&gt;&lt;/h5&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;5. List out first name,last name,salary, commission for all employees&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;h5 style="font-weight: normal; color: rgb(102, 0, 0);" class="myclass"&gt;&lt;span style="font-size:100%;"&gt;Select first_name, last_name, salary, commission from employee;&lt;/span&gt;&lt;/h5&gt;&lt;br /&gt;&lt;div style="text-align: justify;"&gt;&lt;span style="font-weight: bold;"&gt;6. List out employee_id,last name,department id for all  employees and rename employee id as "ID  of the employee", last name as "Name of the employee", department id as  "department  ID"&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;h5 style="font-weight: normal; color: rgb(102, 0, 0);" class="myclass"&gt;&lt;span style="font-size:100%;"&gt;Select employee_id " of the employee", last_name "name", department id as "department id" from employee;&lt;/span&gt;&lt;/h5&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;7. List out the employees annual salary with their names only.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;h5 style="font-weight: normal; color: rgb(102, 0, 0);" class="myclass"&gt;&lt;span style="font-size:100%;"&gt;Select last_name, salary*12 "annual salary" from employee&lt;/span&gt;&lt;/h5&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5626494138934609795-7653026672738346763?l=kiranqa.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/gqD_OF5-UvLI6YQ7y5odA9cVGDU/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/gqD_OF5-UvLI6YQ7y5odA9cVGDU/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/gqD_OF5-UvLI6YQ7y5odA9cVGDU/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/gqD_OF5-UvLI6YQ7y5odA9cVGDU/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/ATestersBlog/~4/NypTF4ET36Y" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://kiranqa.blogspot.com/feeds/7653026672738346763/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://kiranqa.blogspot.com/2010/06/database-testing-sql-simple-queries.html#comment-form" title="1 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/5626494138934609795/posts/default/7653026672738346763?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/5626494138934609795/posts/default/7653026672738346763?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/ATestersBlog/~3/NypTF4ET36Y/database-testing-sql-simple-queries.html" title="Database Testing - SQL - Simple Queries Examples" /><author><name>Kanikaram Kiranpaul</name><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>1</thr:total><feedburner:origLink>http://kiranqa.blogspot.com/2010/06/database-testing-sql-simple-queries.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DUMARHc5fSp7ImA9WxFVFUQ.&quot;"><id>tag:blogger.com,1999:blog-5626494138934609795.post-1530929556503574575</id><published>2010-06-15T03:08:00.000-07:00</published><updated>2010-06-15T03:24:05.925-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-06-15T03:24:05.925-07:00</app:edited><title>Database Testing - SQL - Insertion of Values in the Tables</title><content type="html">&lt;h1 style="text-align: justify;"&gt;To insert values in to these tables we use Data Manipulation Language Command called INSERT which allows us to insert values in to the columns of the table. Any string inserted should be enclosed within ''&lt;/h1&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Syntax:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;h5 style="font-weight: normal; color: rgb(102, 0, 0);" class="myclass"&gt;&lt;span style="font-size:100%;"&gt;Insert [tablename] value (col1, col2, coln)&lt;/span&gt;&lt;/h5&gt;&lt;br /&gt;To insert values in the Location table&lt;br /&gt;&lt;br /&gt;&lt;h5 style="font-weight: normal; color: rgb(102, 0, 0);" class="myclass"&gt;&lt;span style="font-size:100%;"&gt;Insert location&lt;br /&gt;values (122, 'New York'),&lt;br /&gt;(123, 'Dallas'),&lt;br /&gt;(124, 'Chicago'),&lt;br /&gt;(167, 'Boston')&lt;/span&gt;&lt;/h5&gt;&lt;br /&gt;To insert values in the department table&lt;br /&gt;&lt;br /&gt;&lt;h5 style="font-weight: normal; color: rgb(102, 0, 0);" class="myclass"&gt;&lt;span style="font-size:100%;"&gt;Insert department&lt;br /&gt;values (10, 'Accounts', 122),&lt;br /&gt;(20, 'Research', 124),&lt;br /&gt;(30, 'Sales', 123),&lt;br /&gt;(40, 'Operations', 167)&lt;/span&gt;&lt;/h5&gt;&lt;br /&gt;To insert values in the job table&lt;br /&gt;&lt;br /&gt;&lt;h5 style="font-weight: normal; color: rgb(102, 0, 0);" class="myclass"&gt;&lt;span style="font-size:100%;"&gt;Insert job&lt;br /&gt;values (667, 'Clerk'),&lt;br /&gt;(668, 'staff'),&lt;br /&gt;(669, 'analyst'),&lt;br /&gt;(670, 'salesperson'),&lt;br /&gt;(671, 'manager'),&lt;br /&gt;(672, 'president')&lt;/span&gt;&lt;/h5&gt;&lt;br /&gt;To insert values in the employee table&lt;br /&gt;&lt;br /&gt;&lt;h5 style="font-weight: normal; color: rgb(102, 0, 0);" class="myclass"&gt;&lt;span style="font-size:100%;"&gt;insert employee&lt;br /&gt;values (7369,'Smith', 'John', 'Q', 667,7902,'17-Dec-84', 800,'Null' , 20)&lt;br /&gt;&lt;br /&gt;insert employee&lt;br /&gt;values (7499,'Allen', 'Kevin', 'J', 670,7698,'20-Feb-85', 1600, 300, 30)&lt;br /&gt;&lt;br /&gt;insert employee&lt;br /&gt;values (7505,'Doyle', 'Jean', 'K', 671,7839,'04-Apr-85', 2850, 'Null', 30)&lt;br /&gt;&lt;br /&gt;insert employee&lt;br /&gt;values (7506,'Dennis', 'Lynn', 'S', 671,7839,'15-May-85', 2750, 'Null', 30)&lt;br /&gt;&lt;br /&gt;insert employee&lt;br /&gt;values (7507,'Baker', 'Leslie', 'D', 671,7839,'10-Jun-85', 2200, 'Null', 40)&lt;br /&gt;&lt;br /&gt;insert employee&lt;br /&gt;values (7521,'Wark', 'Cynthia', 'D', 670,7698,'22-Feb-85', 1250, 500, 30)&lt;/span&gt;&lt;/h5&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5626494138934609795-1530929556503574575?l=kiranqa.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/i0QAd7oQKAL-RZvYVpDqWpMpE1U/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/i0QAd7oQKAL-RZvYVpDqWpMpE1U/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/i0QAd7oQKAL-RZvYVpDqWpMpE1U/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/i0QAd7oQKAL-RZvYVpDqWpMpE1U/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/ATestersBlog/~4/nEhIrONggYw" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://kiranqa.blogspot.com/feeds/1530929556503574575/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://kiranqa.blogspot.com/2010/06/database-testing-sql-insertion-of.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/5626494138934609795/posts/default/1530929556503574575?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/5626494138934609795/posts/default/1530929556503574575?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/ATestersBlog/~3/nEhIrONggYw/database-testing-sql-insertion-of.html" title="Database Testing - SQL - Insertion of Values in the Tables" /><author><name>Kanikaram Kiranpaul</name><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>0</thr:total><feedburner:origLink>http://kiranqa.blogspot.com/2010/06/database-testing-sql-insertion-of.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DUMBRH47fip7ImA9WxFVFUQ.&quot;"><id>tag:blogger.com,1999:blog-5626494138934609795.post-8544743033710329291</id><published>2010-06-15T02:45:00.000-07:00</published><updated>2010-06-15T03:24:15.006-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-06-15T03:24:15.006-07:00</app:edited><title>Database testing - SQL - Creation of Database and Tables for practice</title><content type="html">&lt;h1 style="text-align: justify;"&gt;First of all let us create a database with tables so that we can use all the examples given in the next posts for practice and this will help us to have a hold on SQL.&lt;/h1&gt;&lt;br /&gt;&lt;br /&gt;To create a database we use the Data Definition Language Command called CREATE&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Syntax:&lt;/b&gt;&lt;br /&gt;&lt;h5 style="font-weight: normal; color: rgb(102, 0, 0);" class="myclass"&gt;&lt;span style="font-size:100%;"&gt;Create database [Name of the database]&lt;/span&gt;&lt;/h5&gt;&lt;br /&gt;&lt;b&gt;Example:&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;&lt;h5 style="font-weight: normal; color: rgb(102, 0, 0);" class="myclass"&gt;&lt;span style="font-size:100%;"&gt;create database Practice&lt;/span&gt;&lt;/h5&gt;&lt;br /&gt;&lt;div style="text-align: justify;"&gt;To create different tables we use the DDL command Create and for tables we need to use the keyword table. We also need to specify the column names and the data type the column holds&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Syntax: &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;h5 style="font-weight: normal; color: rgb(102, 0, 0);" class="myclass"&gt;&lt;span style="font-size:100%;"&gt;Create table [Name of the table]&lt;br /&gt;(&lt;br /&gt;Column 1 Datatype,&lt;br /&gt;Column 2 Datatype,&lt;br /&gt;Column n Datatype&lt;br /&gt;)&lt;/span&gt;&lt;/h5&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Example:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;To create a location table for our Practice Database&lt;br /&gt;&lt;br /&gt;&lt;h5 style="font-weight: normal; color: rgb(102, 0, 0);" class="myclass"&gt;&lt;span style="font-size:100%;"&gt;Create table location&lt;br /&gt;(&lt;br /&gt;location_id int,&lt;br /&gt;regional_group varchar(100)&lt;br /&gt;)&lt;/span&gt;&lt;/h5&gt;&lt;br /&gt;To create a department table for our Practice Database&lt;br /&gt;&lt;br /&gt;&lt;h5 style="font-weight: normal; color: rgb(102, 0, 0);" class="myclass"&gt;&lt;span style="font-size:100%;"&gt;Create table department&lt;br /&gt;(&lt;br /&gt;department_id int,&lt;br /&gt;Name varchar(100),&lt;br /&gt;location_id int&lt;br /&gt;)&lt;/span&gt;&lt;/h5&gt;&lt;br /&gt;To create a job table for our Practice Database&lt;br /&gt;&lt;br /&gt;&lt;h5 style="font-weight: normal; color: rgb(102, 0, 0);" class="myclass"&gt;&lt;span style="font-size:100%;"&gt;Create table job&lt;br /&gt;(job_id int,&lt;br /&gt;function1 varchar(50)&lt;br /&gt;)&lt;/span&gt;&lt;/h5&gt;&lt;br /&gt;To create a employee table for our Practice Database&lt;br /&gt;&lt;br /&gt;&lt;h5 style="font-weight: normal; color: rgb(102, 0, 0);" class="myclass"&gt;&lt;span style="font-size:100%;"&gt;Create table employee&lt;br /&gt;(&lt;br /&gt;employee_id int,&lt;br /&gt;Last_name varchar(100),&lt;br /&gt;First_name varchar(100),&lt;br /&gt;Middle_name varchar(100),&lt;br /&gt;Job_id int,&lt;br /&gt;manager_id int,&lt;br /&gt;hiredate datetime,&lt;br /&gt;salary int,&lt;br /&gt;comm varchar(100) ,&lt;br /&gt;department_id int&lt;br /&gt;)&lt;/span&gt;&lt;/h5&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5626494138934609795-8544743033710329291?l=kiranqa.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/lltcQHik-Ja8JVF-5SCzPWlapU8/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/lltcQHik-Ja8JVF-5SCzPWlapU8/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/lltcQHik-Ja8JVF-5SCzPWlapU8/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/lltcQHik-Ja8JVF-5SCzPWlapU8/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/ATestersBlog/~4/CaZlC-VXRHM" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://kiranqa.blogspot.com/feeds/8544743033710329291/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://kiranqa.blogspot.com/2010/06/database-testing-sql-creation-of.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/5626494138934609795/posts/default/8544743033710329291?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/5626494138934609795/posts/default/8544743033710329291?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/ATestersBlog/~3/CaZlC-VXRHM/database-testing-sql-creation-of.html" title="Database testing - SQL - Creation of Database and Tables for practice" /><author><name>Kanikaram Kiranpaul</name><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>0</thr:total><feedburner:origLink>http://kiranqa.blogspot.com/2010/06/database-testing-sql-creation-of.html</feedburner:origLink></entry><entry gd:etag="W/&quot;A0MMSHw7fCp7ImA9WxFRFk8.&quot;"><id>tag:blogger.com,1999:blog-5626494138934609795.post-2181679425103570778</id><published>2010-04-30T04:56:00.000-07:00</published><updated>2010-04-30T05:11:29.204-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-04-30T05:11:29.204-07:00</app:edited><title>VB Script Examples for Begineers</title><content type="html">&lt;h2 style="text-align: justify;" class="myclass"&gt;Here you will find many VB Script Examples for easy understanding and also when you are perfect in this then you can use the skill to create scripts for QTP 9.2. Vb script on prime numbers, VB script on Functions etc are found here.&lt;/h2&gt;&lt;br /&gt;&lt;h2 class="myclass"&gt;1. Click on &lt;a href="http://kiranqa.blogspot.com/2010/04/answers-to-assignments-for-if-else.html" target="_blank"&gt;&lt;b&gt;Script to Print the Greatest of Three Integers&lt;/b&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;2. Click on &lt;a href="http://kiranqa.blogspot.com/2010/04/answers-to-assignment-on-for-looping.html" target="_blank"&gt;&lt;b&gt;Script to Print different Arithmetic Operations using Select Statement&lt;/b&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;3. Click on &lt;a href="http://kiranqa.blogspot.com/2010/04/script-to-print-prime-numbers.html" target="'_blank'"&gt;&lt;b&gt;Script to Print Prime Numbers&lt;/b&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;4. Click on &lt;a href="http://kiranqa.blogspot.com/2010/04/fibonacci-series-code.html" target="'_blank'"&gt;&lt;b&gt;Script to Generate a Fibonacci Series&lt;/b&gt;&lt;br /&gt;&lt;/a&gt;&lt;/h2&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5626494138934609795-2181679425103570778?l=kiranqa.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/_VPDkL0v0FVNQ7WT6dPRZA4wjTE/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/_VPDkL0v0FVNQ7WT6dPRZA4wjTE/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/_VPDkL0v0FVNQ7WT6dPRZA4wjTE/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/_VPDkL0v0FVNQ7WT6dPRZA4wjTE/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/ATestersBlog/~4/euS4gh5RQgs" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://kiranqa.blogspot.com/feeds/2181679425103570778/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://kiranqa.blogspot.com/2010/04/vb-script-examples.html#comment-form" title="1 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/5626494138934609795/posts/default/2181679425103570778?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/5626494138934609795/posts/default/2181679425103570778?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/ATestersBlog/~3/euS4gh5RQgs/vb-script-examples.html" title="VB Script Examples for Begineers" /><author><name>Kanikaram Kiranpaul</name><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>1</thr:total><feedburner:origLink>http://kiranqa.blogspot.com/2010/04/vb-script-examples.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DUAGQXc8eCp7ImA9WxFRFEk.&quot;"><id>tag:blogger.com,1999:blog-5626494138934609795.post-6211045684372842349</id><published>2010-04-28T02:21:00.000-07:00</published><updated>2010-04-28T02:42:00.970-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-04-28T02:42:00.970-07:00</app:edited><title>Write a VB Script to check whether a given number is prime or not?</title><content type="html">&lt;h2 class="myclass"&gt;&lt;div style="text-align: justify;"&gt;We can use a For Next Loop or Do While Loop to check whether a number given is a prime number or not in VB Script. The challenge lies in writing a VB script without using any built in functions of VB Script.&lt;/div&gt;&lt;/h2&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Method 1&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;h5 style="font-weight: normal; color: rgb(102, 0, 0);"&gt;&lt;span style="font-size:100%;"&gt;a = cint(Inputbox("Enter a number to check whether it is a prime number or not"))&lt;br /&gt;count = 0&lt;br /&gt;b = 1&lt;br /&gt;Do while b&lt;=a&lt;br /&gt;&lt;span style="color: rgb(250, 250, 210);"&gt;aaa&lt;/span&gt;if a mod b = 0 Then&lt;br /&gt;&lt;span style="color: rgb(250, 250, 210);"&gt;aaaaaa&lt;/span&gt;count = count +1&lt;br /&gt;&lt;span style="color: rgb(250, 250, 210);"&gt;aaa&lt;/span&gt;End If &lt;br /&gt;b=b+1&lt;br /&gt;Loop&lt;br /&gt;If count = 2 Then&lt;br /&gt;&lt;span style="color: rgb(250, 250, 210);"&gt;aaa&lt;/span&gt;msgbox "The number "&amp;amp;a&amp;amp; " is a prime number"  &lt;br /&gt;Else  &lt;br /&gt;&lt;span style="color: rgb(250, 250, 210);"&gt;aaa&lt;/span&gt;msgbox "The number "&amp;amp;a&amp;amp; " is not a prime number"&lt;br /&gt;End if&lt;/span&gt;&lt;/h5&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Method 2&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;h5 style="font-weight: normal; color: rgb(102, 0, 0);"&gt;&lt;span style="font-size:100%;"&gt;val=Inputbox("Please enter any number")&lt;br /&gt;valprime = 0&lt;br /&gt;For i=2 to Int(val/2)&lt;br /&gt;&lt;span style="color: rgb(250, 250, 210);"&gt;aaa&lt;/span&gt;If val mod I = 0 Then&lt;br /&gt;&lt;span style="color: rgb(250, 250, 210);"&gt;aaa&lt;/span&gt;msgbox "The number"&amp;amp;val&amp;amp;" is not a prime number"&lt;br /&gt;&lt;span style="color: rgb(250, 250, 210);"&gt;aaa&lt;/span&gt;valprime=1&lt;br /&gt;&lt;span style="color: rgb(250, 250, 210);"&gt;aaa&lt;/span&gt;Exit for&lt;br /&gt;End If&lt;br /&gt;Next&lt;br /&gt;If valprime=0 Then&lt;br /&gt;&lt;span style="color: rgb(250, 250, 210);"&gt;aaa&lt;/span&gt;msgbox "The number"&amp;amp;val&amp;amp;" is a prime number"&lt;br /&gt;End If&lt;/span&gt;&lt;/h5&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5626494138934609795-6211045684372842349?l=kiranqa.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/-XUZbQ6qq0XTwIm1dTUCGlIqeTI/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/-XUZbQ6qq0XTwIm1dTUCGlIqeTI/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/-XUZbQ6qq0XTwIm1dTUCGlIqeTI/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/-XUZbQ6qq0XTwIm1dTUCGlIqeTI/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/ATestersBlog/~4/g-qZcXDXnQs" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://kiranqa.blogspot.com/feeds/6211045684372842349/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://kiranqa.blogspot.com/2010/04/write-vb-script-to-check-whether-given.html#comment-form" title="2 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/5626494138934609795/posts/default/6211045684372842349?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/5626494138934609795/posts/default/6211045684372842349?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/ATestersBlog/~3/g-qZcXDXnQs/write-vb-script-to-check-whether-given.html" title="Write a VB Script to check whether a given number is prime or not?" /><author><name>Kanikaram Kiranpaul</name><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>2</thr:total><feedburner:origLink>http://kiranqa.blogspot.com/2010/04/write-vb-script-to-check-whether-given.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DEMBSHsycCp7ImA9WxFRFEk.&quot;"><id>tag:blogger.com,1999:blog-5626494138934609795.post-6210455065381853491</id><published>2010-04-28T02:18:00.000-07:00</published><updated>2010-04-28T02:20:59.598-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-04-28T02:20:59.598-07:00</app:edited><title>Write a Script in VB to reverse a string given by the user</title><content type="html">&lt;h2 class="myclass"&gt;&lt;div style="text-align: justify;"&gt;This VB Script demonstrates how we can reverse a string or a number given by the user and print it in a reverse order. Here we use Len and Mid methods of VB Script library. In the method one we will find the length of the string and store in y variable and then use a for loop in a descending order and give step as -1.&lt;/div&gt;&lt;/h2&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Method 1&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;&lt;h5 style="font-weight: normal; color: rgb(102, 0, 0);"&gt;&lt;span style="font-size:100%;"&gt;MyStr = InputBox(“Enter a string to be reversed”)&lt;br /&gt;y = Len(MyStr)&lt;br /&gt;For x = y To 1 Step -1&lt;br /&gt;&lt;span style="color: rgb(250, 250, 210);"&gt;aaa&lt;/span&gt;char = Mid(MyStr,x,1)&lt;br /&gt;&lt;span style="color: rgb(250, 250, 210);"&gt;aaa&lt;/span&gt;NewStr = NewStr &amp;amp; char&lt;br /&gt;Next&lt;br /&gt;&lt;span style="color: rgb(250, 250, 210);"&gt;aaa&lt;/span&gt;msgbox newstr&lt;/span&gt;&lt;/h5&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Method 2 using the StrReverse Method.&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;&lt;h5 style="color: rgb(102, 0, 0); font-weight: normal;"&gt;&lt;span style="font-size:100%;"&gt;val=Inputbox("Please enter any number or a string")&lt;br /&gt;a = strReverse(val)&lt;br /&gt;msgbox "The reverse of "&amp;amp;val&amp;amp; " is: "&amp;amp;a&lt;/span&gt;&lt;/h5&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5626494138934609795-6210455065381853491?l=kiranqa.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/fPelc23DdZ_fS6vbpgjW5m4T2eI/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/fPelc23DdZ_fS6vbpgjW5m4T2eI/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/fPelc23DdZ_fS6vbpgjW5m4T2eI/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/fPelc23DdZ_fS6vbpgjW5m4T2eI/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/ATestersBlog/~4/PeY5nRDFqgI" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://kiranqa.blogspot.com/feeds/6210455065381853491/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://kiranqa.blogspot.com/2010/04/write-script-in-vb-to-reverse-string.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/5626494138934609795/posts/default/6210455065381853491?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/5626494138934609795/posts/default/6210455065381853491?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/ATestersBlog/~3/PeY5nRDFqgI/write-script-in-vb-to-reverse-string.html" title="Write a Script in VB to reverse a string given by the user" /><author><name>Kanikaram Kiranpaul</name><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>0</thr:total><feedburner:origLink>http://kiranqa.blogspot.com/2010/04/write-script-in-vb-to-reverse-string.html</feedburner:origLink></entry><entry gd:etag="W/&quot;D0ABSHg8eip7ImA9WxFRFEk.&quot;"><id>tag:blogger.com,1999:blog-5626494138934609795.post-1942921071423340569</id><published>2010-04-28T01:52:00.000-07:00</published><updated>2010-04-28T02:09:19.672-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-04-28T02:09:19.672-07:00</app:edited><title>Write a VB script to print a Text File in reverse way i.e from the Last line to first line</title><content type="html">&lt;h2 class="myclass"&gt;&lt;div style="text-align: justify;"&gt;This VB scripts demonstrates on using the FileSystemObject to read a text file and display the lines in the text file in a reverse order i.e the lines begins with the last line in the text file and ends with the first line as the last line.&lt;/div&gt;&lt;/h2&gt;&lt;br /&gt;&lt;h5 style="font-weight: normal; color: rgb(102, 0, 0);"&gt;&lt;span style="font-size:100%;"&gt;Dim arrLines()&lt;br /&gt;i = 0&lt;br /&gt;&lt;br /&gt;Set FSO = CreateObject("Scripting.FileSystemObject")&lt;br /&gt;Set Fil = FSO.OpenTextFile("F:\TestFolder\Text1.txt", 1)&lt;br /&gt;&lt;br /&gt;Do Until Fil.AtEndOfStream&lt;br /&gt;  &lt;span style="color: rgb(250, 250, 210);"&gt;aaa&lt;/span&gt;Redim Preserve arrLines(i)&lt;br /&gt;  &lt;span style="color: rgb(250, 250, 210);"&gt;aaa&lt;/span&gt;arrLines(i) = Fil.ReadLine&lt;br /&gt;  &lt;span style="color: rgb(250, 250, 210);"&gt;aaa&lt;/span&gt;i = i + 1&lt;br /&gt;Loop&lt;br /&gt;&lt;br /&gt;Fil.Close&lt;br /&gt;&lt;br /&gt;For l = Ubound(arrLines) to LBound(arrLines) Step -1&lt;br /&gt; &lt;span style="color: rgb(250, 250, 210);"&gt;aaa&lt;/span&gt;str = str&amp;amp;arrLines(l)&amp;amp;vbnewline&lt;br /&gt;Next&lt;br /&gt;&lt;br /&gt;msgbox str&lt;/span&gt;&lt;/h5&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5626494138934609795-1942921071423340569?l=kiranqa.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/HoPWuVVHCGoPJPAGzxu-qRERcvo/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/HoPWuVVHCGoPJPAGzxu-qRERcvo/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/HoPWuVVHCGoPJPAGzxu-qRERcvo/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/HoPWuVVHCGoPJPAGzxu-qRERcvo/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/ATestersBlog/~4/BJQhv3JyURg" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://kiranqa.blogspot.com/feeds/1942921071423340569/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://kiranqa.blogspot.com/2010/04/write-vb-script-to-print-text-file-in.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/5626494138934609795/posts/default/1942921071423340569?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/5626494138934609795/posts/default/1942921071423340569?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/ATestersBlog/~3/BJQhv3JyURg/write-vb-script-to-print-text-file-in.html" title="Write a VB script to print a Text File in reverse way i.e from the Last line to first line" /><author><name>Kanikaram Kiranpaul</name><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>0</thr:total><feedburner:origLink>http://kiranqa.blogspot.com/2010/04/write-vb-script-to-print-text-file-in.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CU4GSXsyfSp7ImA9WxFRFEk.&quot;"><id>tag:blogger.com,1999:blog-5626494138934609795.post-4716120943498144467</id><published>2010-04-27T23:43:00.000-07:00</published><updated>2010-04-28T01:38:48.595-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-04-28T01:38:48.595-07:00</app:edited><title>Write a Script to print the phone list in VB Script using Arrays dynamically</title><content type="html">&lt;h2 class="myclass"&gt;&lt;div style="text-align: justify;"&gt;Write a Script to print the phone list in VB Script using Arrays dynamically.&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;div style="text-align: justify;"&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-weight: normal;"&gt;Here we are using a Dynamic array because we do not know the lower and upper bound of the array and the user enters the column and row count for the array. Also we are asking the user to give input the field values for the array. The script in VB looks like this. You can copy the script and paste it in a notepad and save as a .vbs file and execute it.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;/h2&gt;&lt;br /&gt;&lt;h3&gt;Method 1 for writing the script&lt;/h3&gt;&lt;br /&gt;&lt;h5 style="font-weight: normal; color: rgb(102, 0, 0);"&gt;&lt;span style="font-size:100%;"&gt;col = InputBox("Enter the number of Columns")&lt;br /&gt;row = InputBox("Enter the number of Rows")&lt;br /&gt;Dim arrphonelist()&lt;br /&gt;&lt;br /&gt;ReDim arrphonelist(col,row)&lt;br /&gt;&lt;br /&gt;For i = 0 to row&lt;br /&gt;&lt;span style="color: rgb(250, 250, 210);"&gt;aaa&lt;/span&gt;For j = 0 to col&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(250, 250, 210);"&gt;aaaaaa&lt;/span&gt;Arrphonelist(j,i) = InputBox("Enter the First name")&lt;br /&gt;&lt;span style="color: rgb(250, 250, 210);"&gt;aaaaaaaaa&lt;/span&gt;j=j+1&lt;br /&gt;&lt;span style="color: rgb(250, 250, 210);"&gt;aaaaaa&lt;/span&gt;Arrphonelist(j,i) = InputBox("Enter the Last name")&lt;br /&gt;&lt;span style="color: rgb(250, 250, 210);"&gt;aaaaaaaaa&lt;/span&gt;j=j+1&lt;br /&gt;&lt;span style="color: rgb(250, 250, 210);"&gt;aaaaaa&lt;/span&gt;Arrphonelist(j,i) = InputBox("Enter the Phone Number")&lt;br /&gt;&lt;span style="color: rgb(250, 250, 210);"&gt;aaa&lt;/span&gt;Next&lt;br /&gt;Next&lt;br /&gt;&lt;br /&gt;arrubound = ubound(arrphonelist,2)&lt;br /&gt;&lt;br /&gt;For k = 0 to arrubound&lt;br /&gt;&lt;span style="color: rgb(250, 250, 210);"&gt;aaa&lt;/span&gt;str = str&amp;amp;arrphonelist(0,k)&amp;amp;" "&lt;br /&gt;&lt;span style="color: rgb(250, 250, 210);"&gt;aaa&lt;/span&gt;str = str&amp;amp;arrphonelist(1,k)&amp;amp;" "&lt;br /&gt;&lt;span style="color: rgb(250, 250, 210);"&gt;aaa&lt;/span&gt;str = str&amp;amp;arrphonelist(2,k)&amp;amp;vbnewline&lt;br /&gt;Next&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(250, 250, 210);"&gt;aaa&lt;/span&gt;Msgbox "The Phone List is "&amp;amp;vbnewline&amp;amp;str&lt;/span&gt;&lt;/h5&gt;&lt;br /&gt;&lt;br /&gt;&lt;h3&gt;Method 2 where we only ask the number of rows and keep the columns fixed to 3&lt;/h3&gt;&lt;br /&gt;&lt;h5 style="font-weight: normal; color: rgb(102, 0, 0);"&gt;&lt;span style="font-size:100%;"&gt;row = InputBox("Enter the number of Rows")&lt;br /&gt;&lt;br /&gt;Dim arrphonelist()&lt;br /&gt;ReDim arrphonelist(2,row)&lt;br /&gt;&lt;br /&gt;For i = 0 to row -1&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(250, 250, 210);font-size:100%;" &gt;aaa&lt;/span&gt;&lt;span style="font-size:100%;"&gt;For j = 0 to 2&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(250, 250, 210);font-size:100%;" &gt;aaaaaa&lt;/span&gt;&lt;span style="font-size:100%;"&gt;Arrphonelist(0,i) = InputBox("Enter the First name")&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(250, 250, 210);font-size:100%;" &gt;aaaaaaaaa&lt;/span&gt;&lt;span style="font-size:100%;"&gt;j=j+1&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(250, 250, 210);font-size:100%;" &gt;aaaaaa&lt;/span&gt;&lt;span style="font-size:100%;"&gt;Arrphonelist(1,i) = InputBox("Enter the Last name")&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(250, 250, 210);font-size:100%;" &gt;aaaaaaaaa&lt;/span&gt;&lt;span style="font-size:100%;"&gt;j=j+1&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(250, 250, 210);font-size:100%;" &gt;aaaaaa&lt;/span&gt;&lt;span style="font-size:100%;"&gt;Arrphonelist(2,i) = InputBox("Enter the Phone Number")&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(250, 250, 210);font-size:100%;" &gt;aaa&lt;/span&gt;&lt;span style="font-size:100%;"&gt;Next&lt;br /&gt;Next&lt;br /&gt;&lt;br /&gt;arrubound = ubound(arrphonelist,2)&lt;br /&gt;&lt;br /&gt;For k = 0 to arrubound&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(250, 250, 210);font-size:100%;" &gt;aaa&lt;/span&gt;&lt;span style="font-size:100%;"&gt;str = str&amp;amp;arrphonelist(0,k)&amp;amp;" "&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(250, 250, 210);font-size:100%;" &gt;aaa&lt;/span&gt;&lt;span style="font-size:100%;"&gt;str = str&amp;amp;arrphonelist(1,k)&amp;amp;" "&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(250, 250, 210);font-size:100%;" &gt;aaa&lt;/span&gt;&lt;span style="font-size:100%;"&gt;str = str&amp;amp;arrphonelist(2,k)&amp;amp;vbnewline&lt;br /&gt;Next&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(250, 250, 210);font-size:100%;" &gt;aaa&lt;/span&gt;&lt;span style="font-size:100%;"&gt;Msgbox "The Phone List is "&amp;amp;vbnewline&amp;amp;str&lt;/span&gt;&lt;/h5&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5626494138934609795-4716120943498144467?l=kiranqa.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/6Fc7OpYUV4eiMVGbhs7lcR4Hlis/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/6Fc7OpYUV4eiMVGbhs7lcR4Hlis/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/6Fc7OpYUV4eiMVGbhs7lcR4Hlis/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/6Fc7OpYUV4eiMVGbhs7lcR4Hlis/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/ATestersBlog/~4/fSb063MzV40" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://kiranqa.blogspot.com/feeds/4716120943498144467/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://kiranqa.blogspot.com/2010/04/script-to-print-phone-list-in-vb-script.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/5626494138934609795/posts/default/4716120943498144467?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/5626494138934609795/posts/default/4716120943498144467?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/ATestersBlog/~3/fSb063MzV40/script-to-print-phone-list-in-vb-script.html" title="Write a Script to print the phone list in VB Script using Arrays dynamically" /><author><name>Kanikaram Kiranpaul</name><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>0</thr:total><feedburner:origLink>http://kiranqa.blogspot.com/2010/04/script-to-print-phone-list-in-vb-script.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DkcNR3g6cSp7ImA9WxFRFEk.&quot;"><id>tag:blogger.com,1999:blog-5626494138934609795.post-8251440627815270326</id><published>2010-04-27T23:33:00.000-07:00</published><updated>2010-04-28T01:41:36.619-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-04-28T01:41:36.619-07:00</app:edited><title>Write a Script to print a Phone List in VB using Arrays</title><content type="html">&lt;h2 class="myclass"&gt;&lt;div style="text-align: justify;"&gt;Write a Script to print the phone list in VB Script using Arrays.&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;div style="text-align: justify;"&gt;Here we are using a static array because we are giving the lowerbound and upperbound of the array. Also we are giving the array values. The script in VB looks like this. You can copy the script and paste it in a notepad and save as a .vbs file and execute it. You have to remember that the column and Row count in VB using Arrays start by default with zero and hence for 3 columns we are giving 2 because 0 to 2 makes it 3 columns and like wise for rows.&lt;br /&gt;&lt;/div&gt;&lt;/h2&gt;&lt;br /&gt;&lt;h5 style="font-weight: normal; color: rgb(102, 0, 0);"&gt;&lt;span style="font-size:100%;"&gt;'Initializing an array with 3 columns and 4 rows&lt;br /&gt;&lt;br /&gt;Dim arrphonelist(2,3)&lt;br /&gt;&lt;br /&gt;'Giving all the values of different columns for the 4 rows.&lt;br /&gt;Arrphonelist(0,0) = "John"&lt;br /&gt;Arrphonelist(1,0) = "Abharam"&lt;br /&gt;Arrphonelist(2,0) = "9854685623"&lt;br /&gt;&lt;br /&gt;Arrphonelist(0,1) = "Mark"&lt;br /&gt;Arrphonelist(1,1) = "Robin"&lt;br /&gt;Arrphonelist(2,1) = "9955662233"&lt;br /&gt;&lt;br /&gt;Arrphonelist(0,2) = "Peter"&lt;br /&gt;Arrphonelist(1,2) = "Marshal"&lt;br /&gt;Arrphonelist(2,2) = "8080454525"&lt;br /&gt;&lt;br /&gt;Arrphonelist(0,3) = "Alex"&lt;br /&gt;Arrphonelist(1,3) = "Blackston"&lt;br /&gt;Arrphonelist(2,3) = "9865653526"&lt;br /&gt;&lt;br /&gt;'Initializing the upperbound of the array for checking the no of rows&lt;br /&gt;'for this we have entered 2 which represents the 2nd dimension&lt;br /&gt;arrubound = ubound(arrphonelist,2)&lt;br /&gt;&lt;br /&gt;For i = 0 to arrubound&lt;br /&gt;&lt;span style="color: rgb(250, 250, 210);"&gt;aaa&lt;/span&gt;str = str&amp;amp;arrphonelist(0,i)&amp;amp;" "&lt;br /&gt;&lt;span style="color: rgb(250, 250, 210);"&gt;aaa&lt;/span&gt;str = str&amp;amp;arrphonelist(1,i)&amp;amp;" "&lt;br /&gt;&lt;span style="color: rgb(250, 250, 210);"&gt;aaa&lt;/span&gt;str = str&amp;amp;arrphonelist(2,i)&amp;amp;vbnewline&lt;br /&gt;Next&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(250, 250, 210);"&gt;aaa&lt;/span&gt;Msgbox "The Phone List is "&amp;amp;vbnewline&amp;amp;str&lt;/span&gt;&lt;/h5&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5626494138934609795-8251440627815270326?l=kiranqa.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/fA65sUPASNlAM9KKNpuVRJd95jA/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/fA65sUPASNlAM9KKNpuVRJd95jA/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/fA65sUPASNlAM9KKNpuVRJd95jA/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/fA65sUPASNlAM9KKNpuVRJd95jA/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/ATestersBlog/~4/OBh_1GTglIw" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://kiranqa.blogspot.com/feeds/8251440627815270326/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://kiranqa.blogspot.com/2010/04/script-to-print-phone-list-in-vb-using.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/5626494138934609795/posts/default/8251440627815270326?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/5626494138934609795/posts/default/8251440627815270326?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/ATestersBlog/~3/OBh_1GTglIw/script-to-print-phone-list-in-vb-using.html" title="Write a Script to print a Phone List in VB using Arrays" /><author><name>Kanikaram Kiranpaul</name><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>0</thr:total><feedburner:origLink>http://kiranqa.blogspot.com/2010/04/script-to-print-phone-list-in-vb-using.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DkUHQ38-fSp7ImA9WxFRFEk.&quot;"><id>tag:blogger.com,1999:blog-5626494138934609795.post-6819479083037819774</id><published>2010-04-27T23:29:00.000-07:00</published><updated>2010-04-28T01:43:52.155-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-04-28T01:43:52.155-07:00</app:edited><title>Write a Sample VB script using Arrays</title><content type="html">&lt;h2 class="myclass"&gt;&lt;div style="text-align: justify;"&gt;Write a VB script using Array to print different color Names.&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;div style="text-align: justify;"&gt;Here we declared an Array and indexed it to 6 columns even though we gave the index as 5. we need to remember that in VB the index starts from zero. When we declared the array and assigned the values we are now assigning the array upperbound to a variable so that using that variable we can use a for loop to print all the values.&lt;br /&gt;&lt;/div&gt;&lt;/h2&gt;&lt;br /&gt;&lt;h5 style="font-weight: normal; color: rgb(102, 0, 0);"&gt;&lt;span style="font-size:100%;"&gt;Dim arrcolors(5)&lt;br /&gt;&lt;span style="color: rgb(250, 250, 210);"&gt;aaa&lt;/span&gt;arrcolors(0) = "Blue"&lt;br /&gt;&lt;span style="color: rgb(250, 250, 210);"&gt;aaa&lt;/span&gt;arrcolors(1) = "Green"&lt;br /&gt;&lt;span style="color: rgb(250, 250, 210);"&gt;aaa&lt;/span&gt;arrcolors(2) = "Red"&lt;br /&gt;&lt;span style="color: rgb(250, 250, 210);"&gt;aaa&lt;/span&gt;arrcolors(3) = "White"&lt;br /&gt;&lt;span style="color: rgb(250, 250, 210);"&gt;aaa&lt;/span&gt;arrcolors(4) = "Black"&lt;br /&gt;&lt;span style="color: rgb(250, 250, 210);"&gt;aaa&lt;/span&gt;arrcolors(5) = "Yellow"&lt;br /&gt;&lt;br /&gt;arrubound = ubound(arrcolors)&lt;br /&gt;&lt;span style="color: rgb(250, 250, 210);"&gt;aaa&lt;/span&gt;msgbox arrubound&lt;br /&gt;&lt;span style="color: rgb(250, 250, 210);"&gt;aaaaaa&lt;/span&gt;For i = 0 to arrubound&lt;br /&gt;&lt;span style="color: rgb(250, 250, 210);"&gt;aaaaaaaaa&lt;/span&gt;msgbox arrcolors(i)&lt;br /&gt;&lt;span style="color: rgb(250, 250, 210);"&gt;aaaaaa&lt;/span&gt;Next&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(250, 250, 210);"&gt;aaaaaa&lt;/span&gt;For each element in arrcolors&lt;br /&gt;&lt;span style="color: rgb(250, 250, 210);"&gt;aaaaaaaaa&lt;/span&gt;msgbox element&lt;br /&gt;&lt;span style="color: rgb(250, 250, 210);"&gt;aaaaaa&lt;/span&gt;Next&lt;/span&gt;&lt;/h5&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5626494138934609795-6819479083037819774?l=kiranqa.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/P3FfKUTHmH1SiSoV5vouctWj6lA/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/P3FfKUTHmH1SiSoV5vouctWj6lA/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/P3FfKUTHmH1SiSoV5vouctWj6lA/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/P3FfKUTHmH1SiSoV5vouctWj6lA/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/ATestersBlog/~4/I0TLZyHqgzo" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://kiranqa.blogspot.com/feeds/6819479083037819774/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://kiranqa.blogspot.com/2010/04/sample-vb-script-using-arrays.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/5626494138934609795/posts/default/6819479083037819774?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/5626494138934609795/posts/default/6819479083037819774?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/ATestersBlog/~3/I0TLZyHqgzo/sample-vb-script-using-arrays.html" title="Write a Sample VB script using Arrays" /><author><name>Kanikaram Kiranpaul</name><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>0</thr:total><feedburner:origLink>http://kiranqa.blogspot.com/2010/04/sample-vb-script-using-arrays.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DkQERHw8eip7ImA9WxFRFEk.&quot;"><id>tag:blogger.com,1999:blog-5626494138934609795.post-3225717084573999718</id><published>2010-04-26T06:27:00.000-07:00</published><updated>2010-04-28T01:45:05.272-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-04-28T01:45:05.272-07:00</app:edited><title>What is Array in VB scripting</title><content type="html">&lt;h2 class="myclass"&gt;&lt;div style="text-align: justify;"&gt;First of all let us understand what is an array in VB Scripting. How are arrays used in VB Scripting. What is the purpose of array in VB Script. Is there any difference between an array and a variable since both store values? What does an array do and how does an array store values.&lt;br /&gt;&lt;/div&gt;&lt;/h2&gt;&lt;br /&gt;&lt;div style="text-align: justify;"&gt;Array is a matrix of data. The difference between a variable and an array is that a variable holds a single value while an array holds multiple values. Array can be Static and Dynamic.&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;div style="text-align: justify;"&gt;An array is said to be static if the upper limit of the array is known or defined. If the upper limit is not defined and the value is fetched from some other place or a user input it is known as Dynamic array.&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;div style="text-align: justify;"&gt;Arrays should always be declared with a Dim Statement. In VB script a Dynamic array is classified as &lt;span style="font-weight: bold;"&gt;Homogenous&lt;/span&gt; and  &lt;span style="font-weight: bold;"&gt;Heterogeneous&lt;/span&gt;. A Homogenous array hold the same type of data while an heterogeneous array is a mix of different data types.&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Generally an array in VB Script can be of 60 dimensions.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Syntax of a Single Dimensional Array&lt;br /&gt;&lt;br /&gt;&lt;h5 style="font-weight: normal; color: rgb(102, 0, 0);"&gt;&lt;span style="font-size:100%;"&gt;Dim [Array name] (index)&lt;/span&gt;&lt;/h5&gt;&lt;br /&gt;It is to be noted that in an array the index begins with zero.&lt;br /&gt;&lt;br /&gt;Syntax of a two dimensional array&lt;br /&gt;&lt;br /&gt;&lt;h5 style="font-weight: normal; color: rgb(102, 0, 0);"&gt;&lt;span style="font-size:100%;"&gt;Dim [Array name] (column id, row id)&lt;/span&gt;&lt;/h5&gt;&lt;br /&gt;Example of a two dimensional array&lt;br /&gt;&lt;br /&gt;&lt;h5 style="font-weight: normal; color: rgb(102, 0, 0);"&gt;&lt;span style="font-size:100%;"&gt;Dim arrphonelist (2,3)&lt;/span&gt;&lt;/h5&gt;&lt;br /&gt;&lt;div style="text-align: justify;"&gt;Arrphonelist is the name of the array while 2 is the column id and is also known as 1st dimension and 3 is the row id and is also known as 2nd dimension.&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;To get the row count of an array we write like this&lt;br /&gt;&lt;br /&gt;&lt;h5 style="font-weight: normal; color: rgb(102, 0, 0);"&gt;&lt;span style="font-size:100%;"&gt;Row_count = ubound(arrphonelist, 2)&lt;/span&gt;&lt;/h5&gt;&lt;br /&gt;&lt;div style="text-align: justify;"&gt;For column count it is like this even though we predefine the number of rows as a best practice but still to have an idea we write like this&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;h5 style="font-weight: normal; color: rgb(102, 0, 0);"&gt;&lt;span style="font-size:100%;"&gt;column_count = ubound(arrphonelist, 1)&lt;/span&gt;&lt;/h5&gt;&lt;br /&gt;In an array always the columns are fixed and only rows are manipulated.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5626494138934609795-3225717084573999718?l=kiranqa.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/BYg-VlH9FwdgSnI3nlXQpkGxKu8/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/BYg-VlH9FwdgSnI3nlXQpkGxKu8/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/BYg-VlH9FwdgSnI3nlXQpkGxKu8/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/BYg-VlH9FwdgSnI3nlXQpkGxKu8/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/ATestersBlog/~4/JIpk0OBdBIQ" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://kiranqa.blogspot.com/feeds/3225717084573999718/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://kiranqa.blogspot.com/2010/04/arrays-in-vb-scripting.html#comment-form" title="1 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/5626494138934609795/posts/default/3225717084573999718?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/5626494138934609795/posts/default/3225717084573999718?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/ATestersBlog/~3/JIpk0OBdBIQ/arrays-in-vb-scripting.html" title="What is Array in VB scripting" /><author><name>Kanikaram Kiranpaul</name><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>1</thr:total><feedburner:origLink>http://kiranqa.blogspot.com/2010/04/arrays-in-vb-scripting.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DkEGR3c4cSp7ImA9WxFRFEk.&quot;"><id>tag:blogger.com,1999:blog-5626494138934609795.post-4278748733344318160</id><published>2010-04-26T05:05:00.000-07:00</published><updated>2010-04-28T01:50:26.939-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-04-28T01:50:26.939-07:00</app:edited><title>IN Built VB Script Functions</title><content type="html">&lt;h2 class="myclass"&gt;&lt;div style="text-align: justify;"&gt;As far as VB Scripting for QTP is concerned we will look at the four types of In Built Functions of VB scripting since we use them very often in QTP while writing scripts. The four inbuilt functions are&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;1. Data &amp;amp; Time Function&lt;br /&gt;2. String Function&lt;br /&gt;3. Conversion function&lt;br /&gt;4. Array Function&lt;/h2&gt; &lt;br /&gt;&lt;h3&gt;Date &amp;amp; time Function&lt;/h3&gt;CDate: Converts a valid date and time expression to the variant of subtype Date&lt;br /&gt;Date: Returns the current system date&lt;br /&gt;DateAdd: Returns a date to which a specified time interval has been added&lt;br /&gt;DateDiff : Returns the number of intervals between two dates&lt;br /&gt;&lt;br /&gt;Example of DateDiff is&lt;br /&gt;&lt;br /&gt;&lt;h5 style="font-weight: normal; color: rgb(102, 0, 0);"&gt;&lt;span style="font-size:100%;"&gt;Msgbox datediff("d", #mm/dd/yyyy#, Now)&lt;/span&gt;&lt;/h5&gt;&lt;br /&gt;Here d refers Day. This will print the difference in no of days.&lt;br /&gt;&lt;br /&gt;&lt;h3&gt;String Function&lt;/h3&gt;&lt;div style="text-align: justify;"&gt;With a String function we can scan the entire string and also get a count of the no of characters in the string. If needed we can use the Left and Right method to get a particular no of characters either from the left or right side of the string. You can also replace the string with a new value.&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;h5 style="font-weight: normal; color: rgb(102, 0, 0);"&gt;&lt;span style="font-size:100%;"&gt;Str = “This is Friday”&lt;br /&gt;Str = Right (str, 20)&lt;br /&gt;Str = Left (str, 8)&lt;/span&gt;&lt;/h5&gt;&lt;br /&gt;&lt;div style="text-align: justify;"&gt;The Left and Right Methods scan the string from Left/Right and prints the specified no of characters.&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;h5&gt;&lt;span style="color: rgb(102, 0, 0);font-size:100%;" &gt;&lt;span style="font-weight: normal;"&gt;Str = “Hello World”&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: normal;"&gt;Arr = split(str, "o")&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: normal;"&gt;Msgbox arr(0)&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: normal;"&gt;Msgbox arr(1)&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: normal;"&gt;Msgbox arr(2)&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;/h5&gt;&lt;br /&gt;&lt;div style="text-align: justify;"&gt;In the first message box it will print 'Hell', In the Second Message box it will print 'W', in the third message box it will print 'rld'.&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;div style="text-align: justify;"&gt;If you want to check whether a text file is there in a Folder then you need to use the split method to get the text file. After getting the folder using Get Folder and pointing to the files in the folder we need to write these lines of code in the For Next Loop.&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;h5 style="font-weight: normal; color: rgb(102, 0, 0);"&gt;&lt;span style="font-size:100%;"&gt;For each f in fil&lt;br /&gt;str = f.name&lt;br /&gt;arr = split(str, ".")&lt;br /&gt;If arr(1) = "txt" then&lt;br /&gt;var = var&amp;amp;Vbnewline&amp;amp;f.name&lt;br /&gt;End If&lt;br /&gt;Next&lt;/span&gt;&lt;/h5&gt;&lt;br /&gt;Please look at the complete script for printing all the text files in a folder at&lt;br /&gt;&lt;br /&gt;&lt;a href="http://kiranqa.blogspot.com/2010/04/how-to-display-all-text-files-in-folder.html" target="_ blank "&gt;&lt;b&gt; How to display all the Text Files in a Folder&lt;/b&gt;&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5626494138934609795-4278748733344318160?l=kiranqa.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/MfkOEXFEoUuumizmUeI6J1mkzpo/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/MfkOEXFEoUuumizmUeI6J1mkzpo/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/MfkOEXFEoUuumizmUeI6J1mkzpo/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/MfkOEXFEoUuumizmUeI6J1mkzpo/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/ATestersBlog/~4/96FgDQ9ItMw" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://kiranqa.blogspot.com/feeds/4278748733344318160/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://kiranqa.blogspot.com/2010/04/in-built-vb-script-functions.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/5626494138934609795/posts/default/4278748733344318160?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/5626494138934609795/posts/default/4278748733344318160?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/ATestersBlog/~3/96FgDQ9ItMw/in-built-vb-script-functions.html" title="IN Built VB Script Functions" /><author><name>Kanikaram Kiranpaul</name><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>0</thr:total><feedburner:origLink>http://kiranqa.blogspot.com/2010/04/in-built-vb-script-functions.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DkEMRXo4fyp7ImA9WxFRFEk.&quot;"><id>tag:blogger.com,1999:blog-5626494138934609795.post-5914013416501241164</id><published>2010-04-26T02:23:00.000-07:00</published><updated>2010-04-28T01:51:24.437-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-04-28T01:51:24.437-07:00</app:edited><title>How to print all the Lines of a Text File in Excel sheet using VB Script</title><content type="html">&lt;h2 class="myclass"&gt;&lt;div style="text-align: justify;"&gt;Write a script in VB to write all the lines of a Text File into an excel spreadsheet using FileSystemObject&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;div style="text-align: justify;"&gt;VB Script to write all the lines of a text file in to a Excel spread sheet. There are two ways to write all the lines by opening an existing Text File and the second one to create a Text File and write some lines and then writing them in the Excel Sheet.&lt;br /&gt;&lt;/div&gt;&lt;/h2&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Method 1&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;h5 style="font-weight: normal; color: rgb(102, 0, 0);"&gt;&lt;span style="font-size:100%;"&gt;Set objExcel = CreateObject("Excel.Application")&lt;br /&gt;objExcel.Visible=True&lt;br /&gt;&lt;br /&gt;objExcel.workbooks.Add()&lt;br /&gt;&lt;br /&gt;Const ForReading =1&lt;br /&gt;&lt;br /&gt;Set FSO = CreateObject("Scripting.FileSystemObject")&lt;br /&gt;Set file = FSO.OpenTextFile("F:\TestFolder\Text1.txt", 1)&lt;br /&gt;&lt;br /&gt;x=1&lt;br /&gt;&lt;br /&gt;Do Until File.AtEndOfStream&lt;br /&gt;Line = File.ReadLine&lt;br /&gt;objExcel.Cells(x,1) = Line&lt;br /&gt;&lt;br /&gt;x=x+1&lt;br /&gt;Loop&lt;br /&gt;&lt;br /&gt;objFile.Close&lt;/span&gt;&lt;/h5&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Method 2&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;h5 style="font-weight: normal; color: rgb(102, 0, 0);"&gt;&lt;span style="font-size:100%;"&gt;'Script to create and write few lines in a Text file&lt;br /&gt;'and write them in the excel sheet&lt;br /&gt;&lt;br /&gt;'Create an object variable to interact with the File System Object&lt;br /&gt;Set Fso = CreateObject("Scripting.FileSystemObject")&lt;br /&gt;Set xlapp = CreateObject("Excel.Application")&lt;br /&gt;&lt;br /&gt;'Create a text files using CreateTextFile method&lt;br /&gt;Set fil = Fso.CreateTextFile("F:\TestFolder\Text1.txt")&lt;br /&gt;Set wbook = xlapp.Workbooks.Add&lt;br /&gt;set wsheet = xlapp.worksheets(1)&lt;br /&gt;&lt;br /&gt;'Write few lines into the first text file&lt;br /&gt;For i = 1 to 100&lt;br /&gt;fil.WriteLine("This is Line "&amp;amp;i)&lt;br /&gt;Next&lt;br /&gt;&lt;br /&gt;Set fil = nothing&lt;br /&gt;&lt;br /&gt;'Open first text file in read mode and write in excel sheet&lt;br /&gt;Set fil1 = fso.OpenTextFile("F:\TestFolder\Text1.txt",1, False)&lt;br /&gt;&lt;br /&gt;X=1&lt;br /&gt;Do Until fil1.AtEndOfStream&lt;br /&gt;strLine = fil1.ReadLine&lt;br /&gt;xlapp.Cells(x,1) = strLine&lt;br /&gt;X=x+1&lt;br /&gt;Loop&lt;br /&gt;&lt;br /&gt;wbook.SaveAs "F:\TestFolder\Test.xls"&lt;br /&gt;&lt;br /&gt;set wbook=nothing&lt;br /&gt;xlapp.quit&lt;br /&gt;set wsheet = nothing&lt;br /&gt;Set fil = nothing&lt;br /&gt;Set fil1=Nothing&lt;br /&gt;Set fil2 = nothing&lt;/span&gt;&lt;/h5&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5626494138934609795-5914013416501241164?l=kiranqa.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/eLgQqUTxlJlzrcmGAkwkSwQyE8s/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/eLgQqUTxlJlzrcmGAkwkSwQyE8s/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/eLgQqUTxlJlzrcmGAkwkSwQyE8s/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/eLgQqUTxlJlzrcmGAkwkSwQyE8s/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/ATestersBlog/~4/mbUNBXaFJI0" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://kiranqa.blogspot.com/feeds/5914013416501241164/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://kiranqa.blogspot.com/2010/04/how-to-print-all-lines-of-text-file-in.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/5626494138934609795/posts/default/5914013416501241164?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/5626494138934609795/posts/default/5914013416501241164?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/ATestersBlog/~3/mbUNBXaFJI0/how-to-print-all-lines-of-text-file-in.html" title="How to print all the Lines of a Text File in Excel sheet using VB Script" /><author><name>Kanikaram Kiranpaul</name><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>0</thr:total><feedburner:origLink>http://kiranqa.blogspot.com/2010/04/how-to-print-all-lines-of-text-file-in.html</feedburner:origLink></entry><entry gd:etag="W/&quot;D04EQXc8fip7ImA9WxFRFEk.&quot;"><id>tag:blogger.com,1999:blog-5626494138934609795.post-2094251972235740932</id><published>2010-04-25T23:40:00.000-07:00</published><updated>2010-04-28T02:11:40.976-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-04-28T02:11:40.976-07:00</app:edited><title>Write a script in VB to display only the Text Files in a Folder using FileSystemObject</title><content type="html">&lt;h2 class="myclass"&gt;&lt;div style="text-align: justify;"&gt;VB Script used to display only the Text files of a Folder by using the GetFolder and Files method and also arrays to print all the Text Files.&lt;/div&gt;&lt;/h2&gt;&lt;br /&gt;&lt;h5 style="font-weight: normal; color: rgb(102, 0, 0);"&gt;&lt;span style="font-size:100%;"&gt;'Step 1: Create and object variable to interact with the File system object&lt;br /&gt;Set fso = CreateObject("Scripting.FileSystemObject")&lt;br /&gt;&lt;br /&gt;'Step 2: Point to the folder from which we want to print&lt;br /&gt;'the file names&lt;br /&gt;Set fol = fso.GetFolder("F:\TestFolder")&lt;br /&gt;&lt;br /&gt;'Step 3: Return all the files collection from the specified folder&lt;br /&gt;Set fil = Fol.Files&lt;br /&gt;&lt;br /&gt;'Print only the text file names from the specified folder&lt;br /&gt;For each f in fil&lt;br /&gt;str = f.name&lt;br /&gt;arr = split(str, ".")&lt;br /&gt;If arr(1) = "txt" then&lt;br /&gt;var = var&amp;amp;Vbnewline&amp;amp;f.name&lt;br /&gt;End If&lt;br /&gt;Next&lt;br /&gt;&lt;br /&gt;msgbox "The Text Files in the Folder "TestFolder" are: "&amp;amp;vbnewline&amp;amp;var&lt;/span&gt;&lt;/h5&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5626494138934609795-2094251972235740932?l=kiranqa.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/2ALvSDZK99K8vixawOn-fo4UP4I/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/2ALvSDZK99K8vixawOn-fo4UP4I/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/2ALvSDZK99K8vixawOn-fo4UP4I/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/2ALvSDZK99K8vixawOn-fo4UP4I/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/ATestersBlog/~4/HD_VdUJ5Nvk" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://kiranqa.blogspot.com/feeds/2094251972235740932/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://kiranqa.blogspot.com/2010/04/how-to-display-all-text-files-in-folder.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/5626494138934609795/posts/default/2094251972235740932?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/5626494138934609795/posts/default/2094251972235740932?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/ATestersBlog/~3/HD_VdUJ5Nvk/how-to-display-all-text-files-in-folder.html" title="Write a script in VB to display only the Text Files in a Folder using FileSystemObject" /><author><name>Kanikaram Kiranpaul</name><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>0</thr:total><feedburner:origLink>http://kiranqa.blogspot.com/2010/04/how-to-display-all-text-files-in-folder.html</feedburner:origLink></entry><entry gd:etag="W/&quot;A0AHQnw_fip7ImA9Wx5TGE4.&quot;"><id>tag:blogger.com,1999:blog-5626494138934609795.post-3406938922798855396</id><published>2010-04-25T23:30:00.000-07:00</published><updated>2010-08-03T05:48:53.246-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-08-03T05:48:53.246-07:00</app:edited><title>How to display all the files in a Folder in VB Script</title><content type="html">&lt;h1&gt;&lt;div style="text-align: justify;"&gt;Write a script in VB to display all the files in a Folder using FileSystemObject&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;div style="text-align: justify;"&gt;The VB Script to display all the files of a Folder uses the GetFolder and Files method to print all the files.&lt;/div&gt;&lt;/h1&gt;&lt;br /&gt;&lt;h5 style="font-weight: normal; color: rgb(102, 0, 0);"&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="color: rgb(0, 102, 0);"&gt;'Step 1: Create and object variable to interact with the File system object&lt;/span&gt;&lt;br /&gt;Set fso=createobject("Scripting.FileSystemObject")&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 102, 0);font-size:100%;" &gt;'Step 2: Point to the folder from which we want to print &lt;/span&gt;&lt;span style="color: rgb(0, 102, 0);font-size:100%;" &gt;the file names&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size:100%;"&gt;Set fol = fso.GetFolder("F:\YouTube Downloader")&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 102, 0);"&gt;'Step 3: Return all the files collection from the specified folder&lt;/span&gt;&lt;br /&gt;Set fil = fol.files&lt;br /&gt;&lt;br /&gt;'Print all the file names from the specified folder&lt;br /&gt;For each f in fil&lt;br /&gt;str = str&amp;amp;" "&amp;amp;f.name&amp;amp;", "&lt;br /&gt;Next&lt;br /&gt;&lt;br /&gt;Msgbox The files in the Folder YouTube Downloader are " &amp;amp;Vbnewline&amp;amp;str&lt;/span&gt;&lt;/h5&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5626494138934609795-3406938922798855396?l=kiranqa.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/BHK7QYw2IhbXtSTuVYicWQwgKr4/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/BHK7QYw2IhbXtSTuVYicWQwgKr4/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/BHK7QYw2IhbXtSTuVYicWQwgKr4/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/BHK7QYw2IhbXtSTuVYicWQwgKr4/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/ATestersBlog/~4/XXNPTxOQfd0" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://kiranqa.blogspot.com/feeds/3406938922798855396/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://kiranqa.blogspot.com/2010/04/how-to-display-all-files-in-folder-in.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/5626494138934609795/posts/default/3406938922798855396?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/5626494138934609795/posts/default/3406938922798855396?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/ATestersBlog/~3/XXNPTxOQfd0/how-to-display-all-files-in-folder-in.html" title="How to display all the files in a Folder in VB Script" /><author><name>Kanikaram Kiranpaul</name><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>0</thr:total><feedburner:origLink>http://kiranqa.blogspot.com/2010/04/how-to-display-all-files-in-folder-in.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DUYMR304fyp7ImA9WxFSGU8.&quot;"><id>tag:blogger.com,1999:blog-5626494138934609795.post-1527294877761289173</id><published>2010-04-22T01:57:00.000-07:00</published><updated>2010-04-22T02:06:26.337-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-04-22T02:06:26.337-07:00</app:edited><title>Excel Parameters in VB Scripting</title><content type="html">&lt;h1 style="text-align: justify;"&gt;To interact with Excel Library from VB Script we need to create an object which points to the excel library from VB Script.&lt;/h1&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Let us look at some of the common methods used to deal with Excel Library.&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;Workbooks Method is used to point to a work book.&lt;br /&gt;Worksheet method is used to point to a worksheet.&lt;br /&gt;&lt;br /&gt;&lt;div style="text-align: justify;"&gt;Before creating a Workbook or worksheet we need to create an Object to interact with Excel Library.&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;The syntax to create an object is&lt;br /&gt;&lt;br /&gt;&lt;h5 style="font-weight: normal; color: rgb(102, 0, 0);"&gt;&lt;span style="font-size:100%;"&gt;Set [Object] = CreateObject("Excel.Application")&lt;br /&gt;Set xlapp = CreateObject("Excel.Application")&lt;/span&gt;&lt;/h5&gt;&lt;br /&gt;To Create a new workbook we need to use this syntax. The syntax to add a workbook is&lt;br /&gt;&lt;br /&gt;&lt;h5 style="font-weight: normal; color: rgb(102, 0, 0);"&gt;&lt;span style="font-size:100%;"&gt;Set [Variable] = Object.Workbooks.Add&lt;br /&gt;Set wbook = xlapp.Workbooks.Add&lt;/span&gt;&lt;/h5&gt;&lt;br /&gt;&lt;br /&gt;To Open an existing workbook we need to use this syntax. The syntax to open an existing workbook is&lt;br /&gt;&lt;br /&gt;&lt;h5 style="color: rgb(102, 0, 0); font-weight: normal;"&gt;&lt;span style="font-size:100%;"&gt;Set [Variable] = Object.Workbooks.Open (&lt;path&gt;&lt;path&gt;)&lt;br /&gt;Set wbook = xlapp.Workbooks.Open("F:\TestFolder ")&lt;/path&gt;&lt;/path&gt;&lt;/span&gt;&lt;/h5&gt;&lt;br /&gt;To create a worksheet in the workbook we use this syntax and the syntax to create a worksheet is&lt;br /&gt;&lt;br /&gt;&lt;h5 style="color: rgb(102, 0, 0); font-weight: normal;"&gt;&lt;span style="font-size:100%;"&gt;Set [Variable] = Object.worksheets(id)&lt;br /&gt;Set wsheet = xlapp.worksheets(1)&lt;br /&gt;Set wsheet = xlapp.worksheets("Testing")&lt;/span&gt;&lt;/h5&gt;&lt;br /&gt;Here id can be the sheet id and the index begin with 1. You can also give a string for the id but should be enclosed in " ".&lt;br /&gt;&lt;br /&gt;To save a new workbook in a destination we use this syntax&lt;br /&gt;&lt;br /&gt;&lt;h5 style="color: rgb(102, 0, 0); font-weight: normal;"&gt;&lt;span style="font-size:100%;"&gt;Variable.SaveAs (&lt;path&gt;&lt;path&gt;)&lt;br /&gt;wbook.SaveAs(("F:\TestFolder\Test.xls")&lt;/path&gt;&lt;/path&gt;&lt;/span&gt;&lt;/h5&gt;&lt;br /&gt;Every time a workbook is created or opened it should be closed and to close the workbook we need a Close Method. To close a Work book the syntax is&lt;br /&gt;&lt;br /&gt;&lt;h5 style="font-weight: normal; color: rgb(102, 0, 0);"&gt;&lt;span style="font-size:100%;"&gt;Variable.Close&lt;br /&gt;wbook.Close&lt;/span&gt;&lt;/h5&gt;&lt;br /&gt;It is a good practice to quit the application once your work is over and to quit the excel application we need a Quit Method. The syntax is&lt;br /&gt;&lt;br /&gt;&lt;h5 style="font-weight: normal; color: rgb(102, 0, 0);"&gt;&lt;span style="font-size:100%;"&gt;Object.Quit&lt;br /&gt;Xlapp.Quit&lt;/span&gt;&lt;/h5&gt;&lt;br /&gt;As soon as the application is quit it is required to clear the variables so that it does not interfere with other scripts. It is important that the worksheet, workbook, excel application variables should be cleared. To clear the variable used from the memory we use the Nothing Method. The syntax is&lt;br /&gt;&lt;br /&gt;&lt;h5 style="font-weight: normal; color: rgb(102, 0, 0);"&gt;&lt;span style="font-size:100%;"&gt;Set [Object] = Nothing&lt;br /&gt;Set wsheet = Nothing&lt;br /&gt;Set wbook = Nothing&lt;br /&gt;Set xlapp =  Nothing&lt;/span&gt;&lt;/h5&gt;&lt;br /&gt;To create cells in the worksheet we use this syntax&lt;br /&gt;&lt;br /&gt;&lt;h5 style="font-weight: normal; color: rgb(102, 0, 0);"&gt;&lt;span style="font-size:100%;"&gt;wsheet.cells(rows,columns)&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size:100%;"&gt;wsheet.cells(1,1)&lt;/span&gt;&lt;/h5&gt;&lt;br /&gt;Each Cell is identified with Row and Column as (Row, Column)&lt;br /&gt;&lt;br /&gt;Check this script to understand how these methods are used.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://kiranqa.blogspot.com/2010/04/vb-script-using-excel-library-methods.html" target="_blank"&gt;&lt;b&gt;VB Script using Excel Library Methods and Properties&lt;/b&gt;&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5626494138934609795-1527294877761289173?l=kiranqa.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/h_UUjwfO24N0InKGwE8nhPrsm5s/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/h_UUjwfO24N0InKGwE8nhPrsm5s/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/h_UUjwfO24N0InKGwE8nhPrsm5s/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/h_UUjwfO24N0InKGwE8nhPrsm5s/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/ATestersBlog/~4/ZanrNgeZZSo" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://kiranqa.blogspot.com/feeds/1527294877761289173/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://kiranqa.blogspot.com/2010/04/excel-parameters-in-vb-scripting.html#comment-form" title="1 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/5626494138934609795/posts/default/1527294877761289173?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/5626494138934609795/posts/default/1527294877761289173?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/ATestersBlog/~3/ZanrNgeZZSo/excel-parameters-in-vb-scripting.html" title="Excel Parameters in VB Scripting" /><author><name>Kanikaram Kiranpaul</name><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>1</thr:total><feedburner:origLink>http://kiranqa.blogspot.com/2010/04/excel-parameters-in-vb-scripting.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CkUGRH4yfip7ImA9Wx5TGEk.&quot;"><id>tag:blogger.com,1999:blog-5626494138934609795.post-6025046881094167792</id><published>2010-04-22T01:52:00.000-07:00</published><updated>2010-08-03T05:57:05.096-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-08-03T05:57:05.096-07:00</app:edited><title>VB Script using Excel Library Methods and Properties</title><content type="html">&lt;h1 style="text-align: justify;"&gt;Write a Script to create a workbook and create a worksheet and add information in the cells in VB script using Excel Library.&lt;/h1&gt;&lt;br /&gt;The Script to &lt;span style="font-weight: bold;"&gt;create a workbook and worksheets&lt;/span&gt; with cells is given below.&lt;br /&gt;&lt;br /&gt;&lt;h5 style="font-weight: normal;"&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="color: rgb(0, 102, 0);"&gt;'Create an Object variable to interact with Excel Library&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold; color: rgb(0, 0, 153);"&gt;Set&lt;/span&gt; xlapp = &lt;span style="font-weight: bold; color: rgb(0, 0, 153);"&gt;CreateObject&lt;/span&gt;(&lt;span style="color: rgb(102, 0, 0);"&gt;"Excel.Application"&lt;/span&gt;)&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 102, 0);"&gt;'Create New Excel Workbook using the xlapp object&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold; color: rgb(0, 0, 153);"&gt;Set&lt;/span&gt; wbook = xlapp.workbooks.&lt;span style="font-weight: bold; color: rgb(0, 0, 153);"&gt;Add&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 102, 0);"&gt;'Create a pointer to the first sheet in the workbook&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold; color: rgb(0, 0, 153);"&gt;Set&lt;/span&gt; wsheet = xlapp.worksheets(&lt;span style="color: rgb(102, 0, 0);"&gt;1&lt;/span&gt;)&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 102, 0);"&gt;'Here we are adding the data in first column and color in second column&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold; color: rgb(0, 0, 153);"&gt;For&lt;/span&gt; i = &lt;span style="color: rgb(102, 0, 0);"&gt;1&lt;/span&gt; to &lt;span style="color: rgb(102, 0, 0);"&gt;56&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;wsheet.cells(i,1).value = &lt;span style="color: rgb(102, 0, 0);"&gt;"The code of this color is: "&lt;/span&gt;&amp;amp;i&lt;br /&gt;wsheet.cells(i,1).font.&lt;span style="color: rgb(0, 0, 153); font-weight: bold;"&gt;Name&lt;/span&gt; = &lt;span style="color: rgb(102, 0, 0);"&gt;"Verdana"&lt;/span&gt;&lt;br /&gt;wsheet.cells(i,1).font.&lt;span style="font-weight: bold; color: rgb(0, 0, 153);"&gt;Size&lt;/span&gt; = 14&lt;br /&gt;wsheet.cells(i,1).font.bold=&lt;span style="font-weight: bold; color: rgb(0, 0, 153);"&gt;TRUE&lt;/span&gt;&lt;br /&gt;wsheet.cells(i,1).font.colorindex=i&lt;br /&gt;wsheet.cells(i,2).interior.colorindex=i&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold; color: rgb(0, 0, 153);"&gt;Next&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;wbook.SaveAs &lt;span style="color: rgb(102, 0, 0);"&gt;"F:\Textexcel.xls"&lt;/span&gt;&lt;br /&gt;wbook.&lt;span style="font-weight: bold; color: rgb(0, 0, 153);"&gt;Close&lt;/span&gt;&lt;br /&gt;xlapp.Quit&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 102, 0);"&gt;'Releasing the objects&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold; color: rgb(0, 0, 153);"&gt;Set&lt;/span&gt; wsheet=&lt;span style="font-weight: bold; color: rgb(0, 0, 153);"&gt;Nothing&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold; color: rgb(0, 0, 153);"&gt;Set&lt;/span&gt; wbook=&lt;span style="font-weight: bold; color: rgb(0, 0, 153);"&gt;Nothing&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold; color: rgb(0, 0, 153);"&gt;Set&lt;/span&gt; xlapp = &lt;span style="color: rgb(0, 0, 153); font-weight: bold;"&gt;Nothing&lt;/span&gt;&lt;/span&gt;&lt;/h5&gt;&lt;br /&gt;&lt;div style="text-align: justify;"&gt;Once you run this script go to the folder where the excel workbook is created and open and see how it looks like. The work sheet now contains information in two columns and in the Cell (1,1) you will find the value as The code of this color is 1 in black color and in bold and in the cell (1,2) you will find the cell filled with black color and like wise till row number 56.&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;You can manipulate the cells or using the wsheet.cells(rows,columns) syntax.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5626494138934609795-6025046881094167792?l=kiranqa.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/n1erhstnJChzjrPUMW2IAvH6niM/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/n1erhstnJChzjrPUMW2IAvH6niM/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/n1erhstnJChzjrPUMW2IAvH6niM/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/n1erhstnJChzjrPUMW2IAvH6niM/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/ATestersBlog/~4/iLpr69AOszs" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://kiranqa.blogspot.com/feeds/6025046881094167792/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://kiranqa.blogspot.com/2010/04/vb-script-using-excel-library-methods.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/5626494138934609795/posts/default/6025046881094167792?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/5626494138934609795/posts/default/6025046881094167792?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/ATestersBlog/~3/iLpr69AOszs/vb-script-using-excel-library-methods.html" title="VB Script using Excel Library Methods and Properties" /><author><name>Kanikaram Kiranpaul</name><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>0</thr:total><feedburner:origLink>http://kiranqa.blogspot.com/2010/04/vb-script-using-excel-library-methods.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DkQNQXY6cCp7ImA9WxFSGEg.&quot;"><id>tag:blogger.com,1999:blog-5626494138934609795.post-7584963868216137278</id><published>2010-04-21T05:51:00.000-07:00</published><updated>2010-04-21T05:53:10.818-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-04-21T05:53:10.818-07:00</app:edited><title>Creating and Managing Folders using VB Script</title><content type="html">&lt;h1 style="text-align: justify;"&gt;We can create Folders in VB Script interacting with File System Object. So using the script we can create folder, manipulate with folders etc through VB Scripting.&lt;/h1&gt;&lt;br /&gt;&lt;br /&gt;&lt;div style="text-align: justify;"&gt;Create Folder Method creates a folder in the location specified. If a folder already exists with the same name an error occurs. The CreateFolder method always returns a Folder object if it is not there. The syntax of the CreateFolder method is&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;h5 style="font-weight: normal; color: rgb(102, 0, 0);"&gt;&lt;span style="font-size:100%;"&gt;object.CreateFolder(foldername)&lt;/span&gt;&lt;/h5&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Example 1: Write a script to print all the file names from a folder.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;h5 style="font-weight: normal; color: rgb(102, 0, 0);"&gt;&lt;span style="font-size:100%;"&gt;'Step 1: Create and object variable to interact with the File system object&lt;br /&gt;Set fso=createobject("Scripting.filesystemobject")&lt;br /&gt;&lt;br /&gt;'Step 2: Point to the folder from which we want to print&lt;br /&gt;'the file names&lt;br /&gt;Set fol = fso.GetFolder("F:\YouTube Downloader")&lt;br /&gt;&lt;br /&gt;'Step 3: Return all the files collection from the specified folder&lt;br /&gt;Set fil = fol.files&lt;br /&gt;&lt;br /&gt;'Print all the file names from the specified folder&lt;br /&gt;For each f in fil&lt;br /&gt;str = str&amp;amp;" "&amp;amp;f.name&amp;amp;", "&lt;br /&gt;Next&lt;br /&gt;&lt;br /&gt;Msgbox "The file name is: "&amp;amp;str&lt;/span&gt;&lt;/h5&gt;&lt;br /&gt;If we look in the above script we look at this line str = str&amp;amp;" "&amp;amp;f.name&amp;amp;", "&lt;br /&gt;&lt;br /&gt;&lt;div style="text-align: justify;"&gt;Let me explain what actually happens. In order to print all the file names in a single message box we need to initialize a string in the loop and assign the string with str and concatenate with space and f.name (file name) and a comma so that each file will be displayed separated by a comma. What happens is that the str will start storing all the file names until the loop is terminated and this string is used in the message box to print the desired output.&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;div style="text-align: justify;"&gt;For each statement is used to point to each file till it reaches the end of the file collection. Here f variable is used to point to each file in the collection.&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5626494138934609795-7584963868216137278?l=kiranqa.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/J0jVSNiVjLerBq1Z9ZyL7FPhs4o/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/J0jVSNiVjLerBq1Z9ZyL7FPhs4o/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/J0jVSNiVjLerBq1Z9ZyL7FPhs4o/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/J0jVSNiVjLerBq1Z9ZyL7FPhs4o/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/ATestersBlog/~4/L4y9jbuaXYQ" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://kiranqa.blogspot.com/feeds/7584963868216137278/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://kiranqa.blogspot.com/2010/04/creating-and-managing-folders-using-vb.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/5626494138934609795/posts/default/7584963868216137278?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/5626494138934609795/posts/default/7584963868216137278?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/ATestersBlog/~3/L4y9jbuaXYQ/creating-and-managing-folders-using-vb.html" title="Creating and Managing Folders using VB Script" /><author><name>Kanikaram Kiranpaul</name><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>0</thr:total><feedburner:origLink>http://kiranqa.blogspot.com/2010/04/creating-and-managing-folders-using-vb.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DkQHRHw_eSp7ImA9WxFREks.&quot;"><id>tag:blogger.com,1999:blog-5626494138934609795.post-1951091952260422779</id><published>2010-04-21T05:43:00.000-07:00</published><updated>2010-04-25T23:45:35.241-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-04-25T23:45:35.241-07:00</app:edited><title>Script to create a file and add odd line to second file</title><content type="html">&lt;h1 style="text-align: justify;"&gt;Write a Script to create two text files and write some lines in the first file and copy the odd lines of the first file in to the second file.&lt;br /&gt;&lt;br /&gt;&lt;style="text-align:&gt;Writing a VB Script using WriteLine and ReadLine Methods of FileSystemObject to generate the required result&lt;/style="text-align:&gt;&lt;/h1&gt;&lt;br /&gt;&lt;h5 style="font-weight: normal; color: rgb(102, 0, 0);"&gt;&lt;span style="font-size:100%;"&gt;'Script to create two text files,&lt;br /&gt;'Write few lines into the first text file.&lt;br /&gt;'Copy all the odd lines from the&lt;br /&gt;'first text file to the second text file&lt;br /&gt;&lt;br /&gt;'Create an object variable to interact with the File System Object&lt;br /&gt;Set Fso = CreateObject("Scripting.FileSystemObject")&lt;br /&gt;&lt;br /&gt;'Create Two text files using CreateTextFile method&lt;br /&gt;Set fil = Fso.CreateTextFile("F:\Text1.txt")&lt;br /&gt;Fso.CreateTextFile("F:\Text2.txt")&lt;br /&gt;&lt;br /&gt;'Write few lines into the first text file&lt;br /&gt;For i = 1 to 100&lt;br /&gt;fil.WriteLine("This is Line "&amp;amp;i)&lt;br /&gt;Next&lt;br /&gt;&lt;br /&gt;Set fil = nothing&lt;br /&gt;&lt;br /&gt;'Open first text file in read mode and second one in write mode&lt;br /&gt;Set fil1 = fso.OpenTextFile("F:\Text1.txt",1, False)&lt;br /&gt;Set fil2 = fso.OpenTextFile("F:\Text2.txt",2, False)&lt;br /&gt;&lt;br /&gt;'Scan text file until we reach the endofstream&lt;br /&gt;'Set the line number for every time scanned the file&lt;br /&gt;'if the line number is odd copy in the second file&lt;br /&gt;Do While Not fil1.AtEndOfStream&lt;br /&gt;Line_number = fil1.line&lt;br /&gt;If Line_number MOD 2 &lt;&gt; 0 Then&lt;br /&gt;fil2.WriteLine(fil1.ReadLine)&lt;br /&gt;Else&lt;br /&gt;fil1.SkipLine&lt;br /&gt;End If&lt;br /&gt;Loop&lt;br /&gt;&lt;br /&gt;Set fil = nothing&lt;br /&gt;Set fil1=Nothing&lt;br /&gt;Set fil2 = nothing&lt;/span&gt;&lt;/h5&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5626494138934609795-1951091952260422779?l=kiranqa.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/OfWtm27vQTYeVizI8iXdPd2qdvU/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/OfWtm27vQTYeVizI8iXdPd2qdvU/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/OfWtm27vQTYeVizI8iXdPd2qdvU/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/OfWtm27vQTYeVizI8iXdPd2qdvU/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/ATestersBlog/~4/xpVzZfr07C8" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://kiranqa.blogspot.com/feeds/1951091952260422779/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://kiranqa.blogspot.com/2010/04/script-to-create-file-and-add-odd-line.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/5626494138934609795/posts/default/1951091952260422779?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/5626494138934609795/posts/default/1951091952260422779?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/ATestersBlog/~3/xpVzZfr07C8/script-to-create-file-and-add-odd-line.html" title="Script to create a file and add odd line to second file" /><author><name>Kanikaram Kiranpaul</name><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>0</thr:total><feedburner:origLink>http://kiranqa.blogspot.com/2010/04/script-to-create-file-and-add-odd-line.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CUACSHY_cSp7ImA9WxFSGEg.&quot;"><id>tag:blogger.com,1999:blog-5626494138934609795.post-3323590897602330021</id><published>2010-04-21T05:38:00.000-07:00</published><updated>2010-04-21T05:42:49.849-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-04-21T05:42:49.849-07:00</app:edited><title>Write and Writeline Method in VB script</title><content type="html">&lt;h1 style="text-align: justify;"&gt;We can use VB script to create a text file and write some lines in the text file using the File System Object.&lt;/h1&gt;&lt;br /&gt;&lt;br /&gt;&lt;h3&gt;Write Method&lt;/h3&gt;&lt;br /&gt;&lt;br /&gt;&lt;div style="text-align: justify;"&gt;Write Method writes a line and the cursor is placed at the end of the line and the next line will be continued from the end of the first line. Write Method writes a specified string to a Text Stream file.&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;The Syntax of the Write Method is&lt;br /&gt;&lt;br /&gt;&lt;h5 style="font-weight: normal; color: rgb(102, 0, 0);"&gt;&lt;span style="font-size:100%;"&gt;object.Write(string)&lt;/span&gt;&lt;/h5&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Example: To write a script to print 10 lines.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;h5 style="font-weight: normal; color: rgb(102, 0, 0);"&gt;&lt;span style="font-size:100%;"&gt;'Create a text file and write some lines into it&lt;br /&gt;'Step 1: Create and object variable to interact with the File system object&lt;br /&gt;set fso=CreateObject("Scripting.filesystemobject")&lt;br /&gt;&lt;br /&gt;'Step 2: Create the test file.&lt;br /&gt;set fil = fso.CreateTextFile("F:\Test1.txt")&lt;br /&gt;&lt;br /&gt;'Step 3: Writing the lines into the file using For Loop&lt;br /&gt;For i = 1 to 10&lt;br /&gt;fil.Write ("This is line "&amp;amp;i)&lt;br /&gt;Next&lt;/span&gt;&lt;/h5&gt;&lt;br /&gt;&lt;br /&gt;When the script is executed it displays the 10 lines like this.&lt;br /&gt;&lt;br /&gt;&lt;h5 style="font-weight: normal; color: rgb(102, 0, 0);"&gt;&lt;span style="font-size:100%;"&gt;This is line 1This is line 2This is line 3This is line 4This is line 5This is line 6This is line 7This is line 8This is line 9This is line 10&lt;/span&gt;&lt;/h5&gt;&lt;br /&gt;&lt;br /&gt;&lt;h3&gt;WriteLine Method&lt;/h3&gt;&lt;br /&gt;&lt;br /&gt;&lt;div style="text-align: justify;"&gt;WriteLine method write statements in different lines. The cursor is placed at the next Line or New Line. Writes a specified string and newline character to a TextStream file.&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;The syntax of the WriteLine method is&lt;br /&gt;&lt;br /&gt;&lt;h5 style="font-weight: normal; color: rgb(102, 0, 0);"&gt;&lt;span style="font-size:100%;"&gt;object.WriteLine([string])&lt;/span&gt;&lt;/h5&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Example: To write a script to print 10 lines in different rows.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;h5 style="font-weight: normal; color: rgb(102, 0, 0);"&gt;&lt;span style="font-size:100%;"&gt;'Create a text file and write some lines into it&lt;br /&gt;'Step 1: Create and object variable to interact with the File system object&lt;br /&gt;set fso=CreateObject("Scripting.filesystemobject")&lt;br /&gt;&lt;br /&gt;'Step 2: Create the test file.&lt;br /&gt;set fil = fso.CreateTextFile("F:\Test1.txt")&lt;br /&gt;&lt;br /&gt;'Step 3: Writing the lines into the file using For Loop&lt;br /&gt;For i = 1 to 10&lt;br /&gt;fil.WriteLine ("This is line "&amp;amp;i)&lt;br /&gt;Next&lt;/span&gt;&lt;/h5&gt;&lt;br /&gt;&lt;br /&gt;When this script is executed the output is displayed like this&lt;br /&gt;&lt;br /&gt;&lt;h5 style="font-weight: normal; color: rgb(102, 0, 0);"&gt;&lt;span style="font-size:100%;"&gt;This is line 1&lt;br /&gt;This is line 2&lt;br /&gt;This is line 3&lt;br /&gt;This is line 4&lt;br /&gt;This is line 5&lt;br /&gt;This is line 6&lt;br /&gt;This is line 7&lt;br /&gt;This is line 8&lt;br /&gt;This is line 9&lt;br /&gt;This is line 10&lt;/span&gt;&lt;/h5&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5626494138934609795-3323590897602330021?l=kiranqa.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/XPVn9BiW_836ouA0PSlX01Gm8KA/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/XPVn9BiW_836ouA0PSlX01Gm8KA/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/XPVn9BiW_836ouA0PSlX01Gm8KA/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/XPVn9BiW_836ouA0PSlX01Gm8KA/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/ATestersBlog/~4/YWaHJgE14Mw" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://kiranqa.blogspot.com/feeds/3323590897602330021/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://kiranqa.blogspot.com/2010/04/write-and-writeline-method-in-vb-script.html#comment-form" title="2 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/5626494138934609795/posts/default/3323590897602330021?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/5626494138934609795/posts/default/3323590897602330021?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/ATestersBlog/~3/YWaHJgE14Mw/write-and-writeline-method-in-vb-script.html" title="Write and Writeline Method in VB script" /><author><name>Kanikaram Kiranpaul</name><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>2</thr:total><feedburner:origLink>http://kiranqa.blogspot.com/2010/04/write-and-writeline-method-in-vb-script.html</feedburner:origLink></entry></feed>

