Hi Rakesh,
Try this code :

# first you create the connection string (example is with SQL Server)

Constr = "DRIVER=SQL
Server;SERVER=SHANTANU-PC\SQLEXPRESS;UID=SHANTANU;Trusted_Connection=Yes;APP=QuickTest
Professional;WSID=SHANTANU-PC;DATABASE=XYZ"
#Establish the connection
Set mycon = createobject("ADODB.connection")
mycon.Open Constr
#Once connection is established, time to play with record set in the DB

Set myrs = createobject("ADODB.recordset")
myrs.Open "select * from location",mycon

Database handling via VBScript is basically done with following steps:
1. Creating the object of ADODB
2. Define the Connection String  for the database to connect
3. Opening the connection
4. Firing of the query
5. Accessing data with Record Set Object
6. Closing the connection
7. Release the memory occupied by the Objects.


Thanks and regards
Shantanu jain
Cell: +91 9611133087



On Thu, Jul 24, 2014 at 10:02 AM, Ashish Gupta <[email protected]
> wrote:

> hi, you can use following codes ( may be u need to modify a bit)
>
> Set gobjConnectionAs400 = CreateObject("ADODB.Connection")
>     gobjConnectionAs400.CommandTimeout= 600
>
>     gobjConnectionAs400.ConnectionString = "Driver=iSeries Access ODBC
> Driver;System="& Environment("DBURL") & ";Uid=" &  Environment("DBUSER") &
> ";Pwd="&  Environment("DBPASSWORD")   &"; ":gobjConnectionAs400.Open
>
> Thanks,
> Ashish gupta
> Gurgaon,Haryana
>
>
> On Thu, Jul 24, 2014 at 8:28 AM, palyam rakesh <[email protected]>
> wrote:
>
>> Hi all,
>>
>> *Scenario:* My machine is configured with Data Studio client, where my
>> required DB2 data base is configured. Through Data Studio, connection is
>> successful. Here are configuration parameters I am having - Connection,
>> Host, Username, Password, Port, Connection URL.
>> When connection is established to data base, in the trace view I got to
>> know "Run method as - JDBC".
>>
>> *DB2 details* - DB2 for z/OS (V10)
>>
>> *Requirement* - I have to make connectivity to DB2 through UFT / QTP.
>>
>> *Queries -*
>> 1. Can we make DB2 connectivity with UFT with out installing any drivers
>> / DSN configuration ? If so, based on the configuration parameters I am
>> having, what will be the connection string ?
>> 2. If DB2  connectivity with UFT can be done only with installation of
>> drivers, then which drivers to be installed -  JDBC / ODBC ? (From data
>> studio, connection is through JDBC)
>> - Could anyone pls share the process to install & configure drivers &
>> connection string that can be used in script.
>>
>> *Thanks in advance !*
>>
>> --
>> --
>> You received this message because you are subscribed to the Google
>> "QTP - HP Quick Test Professional - Automated Software Testing"
>> group.
>> To post to this group, send email to [email protected]
>> To unsubscribe from this group, send email to
>> [email protected]
>> For more options, visit this group at
>> http://groups.google.com/group/MercuryQTP?hl=en
>>
>> ---
>> You received this message because you are subscribed to the Google Groups
>> "QTP - HP Quick Test Professional - Automated Software Testing" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to [email protected].
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>  --
> --
> You received this message because you are subscribed to the Google
> "QTP - HP Quick Test Professional - Automated Software Testing"
> group.
> To post to this group, send email to [email protected]
> To unsubscribe from this group, send email to
> [email protected]
> For more options, visit this group at
> http://groups.google.com/group/MercuryQTP?hl=en
>
> ---
> You received this message because you are subscribed to the Google Groups
> "QTP - HP Quick Test Professional - Automated Software Testing" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> For more options, visit https://groups.google.com/d/optout.
>

-- 
-- 
You received this message because you are subscribed to the Google
"QTP - HP Quick Test Professional - Automated Software Testing"
group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/MercuryQTP?hl=en

--- 
You received this message because you are subscribed to the Google Groups "QTP 
- HP Quick Test Professional - Automated Software Testing" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to