Q) How do we connect to database using Rational Robot?

Showing Answers 1 - 4 of 4 Answers

kiran

  • May 25th, 2006
 

1. First we need to create script for single use test

2. Datapools are created

3. Script are edited whih will work for large number of data

  Was this answer useful?  Yes

Tarun

  • Jun 15th, 2006
 

Firstly You have to set a user/system DSN in your system which is invoked in rational by using SQAbasic commands.

SQLOpen() function establishes the connection

SQLExecQuery() function will execute the query using connection established.SQLRetrieve( ) function is used to retrieve the result of the query & store it in array form.

  Was this answer useful?  Yes

Prithvi Krishna

  • Aug 6th, 2006
 

To add to Tarun's comments - there's also SQLRequest function which accepts conn string, query etc and also returns a result set.

  Was this answer useful?  Yes

sandeep namdeo

  • Sep 5th, 2006
 

First You have to make SYSTEM DSN .For that follow this

Start -> settings -> control panel -> Administrator Tools -> Data Sources(ODBC) : then click on SYSTEM DSN and create your DSN.(For this U have to create your database in MS-access or SQL server 2000 as per ur choice.)

then use this code

'    Dim connection As Long
'    Dim destination(1 To 50, 1 To 125)  As Variant
'    Dim retcode As long
'    Dim query as String
'    Dim outputStr as String

'    connection = SQLOpen("DSN=master1",outputStr,prompt:=1)
'    query = "select * from data1"  'Execute the query
'    retcode = SQLExecQuery(connection,query)
'    msgbox retcode


This last stmt shows you the retcode id connection successfully establised the a positive code will retured else negative code will be there.

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions