Can u please help me by giving the code to connect to SQL using QTP.Actually i created the Driver but i dont know the code to make connection of QTP and SQL using this driver.
I have to pass a query and i have to use the results of that query for the future testing
Here is how I do it for an ADODB connection. It uses extra lines by establishing variables rather than just imbedding those values in the connection string, but I like the look this way - easier to view the individual parts.
Dim oConn, objRecordset 'Database Connection objects
Dim DBAlias, UID, PWD 'Database Connection variables
'Set the database variables
DBAlias = "Aaaa" 'Name of the database
UID = "Bbbb" 'User ID
PWD="Cccc" 'User Password
'open data base connection
ConnectionString = "DSN=" & DBAlias &";UID=" & UID & ";PWD=" & PWD & ";DBALIAS=" & DBAlias &";"
Set oConn = CreateObject("ADODB.Connection")
Set objRecordset = CreateObject("ADODB.Recordset")
oConn.ConnectionString = ConnectionString