Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Connecting SQL Server with QTP
#1
Solved: 11 Years, 3 Months, 3 Weeks ago
Hi All,

Please can any body tell me the way to connect to SQL server through QTP!

Regards,
Ritu
Reply
#2
Solved: 11 Years, 3 Months, 3 Weeks ago
Hi,
Try this out

Code:
objConxn.Errors.Clear
    With objConxn
        If .State = adStateClosed Then
            .Provider = "sqloledb"
            .Properties("Data Source").Value = DB_Server
            .Properties("Initial Catalog").Value = DB_Name
            If Len(Trim(DB_UserName)) = 0 And Len(Trim(DB_Password)) = 0 Then
                .Properties("Integrated Security").Value = "SSPI"
            Else
                .Properties("User Id") = DB_UserName
                .Properties("Password") = DB_Password
            End If
            .CommandTimeout = 0
            .Open
        End If
    End With
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  QTP License Server Upgrade connect_harish 0 831 04-12-2019, 10:20 PM
Last Post: connect_harish
  Connecting to Cognos TM1 Cube using UFT/QTP anujkabra1985 0 1,697 10-09-2015, 01:51 AM
Last Post: anujkabra1985
  Getting error while connecting from qtp to oracle sql developer. Ritanjali Pradhan 1 3,204 09-26-2014, 02:06 PM
Last Post: vinod123
Exclamation QTP 11.0 crash on batch execution from QC 11.0 after patch 15 installed on QC server akothuru 0 2,170 02-13-2014, 03:27 PM
Last Post: akothuru
  Not able to connect to Oracle SQL Developer Paras Singh 0 6,779 05-30-2013, 01:25 PM
Last Post: Paras Singh

Forum Jump:


Users browsing this thread: 1 Guest(s)