Kevin W.
Kevin W.

Reputation: 49

QTP connection string for Sybase 16 database?

I can't seem to get my connection string correct.

Dim conn, rs

Set conn= createobject("adodb.connection")
set rs = createobject("adodb.recordset")

conn.Open "Provider=Sybase.ASEOLEDBProvider;Server Name = xxx.xxx.xxx.xxx,yyyy;User Id=user;Password=pwd;Database=mydatabase;"
rs.open "Select * from blah", conn

I keep getting an error stating, "Provider cannot be found. It may not be properly installed."

I know the provider is installed because I use the same computer for coding up C# applications that connect to Sybase 16 successfully all the time. Does anyone know the correct connection string for QTP/UFT?

Upvotes: 0

Views: 1146

Answers (2)

sreedhar garimella
sreedhar garimella

Reputation: 11

There is way to connect if it is in windows 7 Function 

ConnectionTest()

DB_CONNECT_STRING = "Provider=OraOLEDB.Oracle; Data Source=(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=" & myHostName & ")(PORT=1521))(CONNECT_DATA=(SERVICE_NAME=" & myServiceNameOrSID & "))); User ID=" & myUsername & ";Password=" & myPassword & ";"


Set myConn = CreateObject("ADODB.Connection")
Set objRecordSet = CreateObject("ADODB.Recordset")



myConn.Open DB_CONNECT_STRING
objRecordSet.Open myQuery, myConn
Wscript.Echo objRecordSet.fields.item(1) & " " & objRecordSet.fields.item(2)
myConn.Close


End function



Call ConnectionTest()


if there is problem in mapping adodb driver need to invoke the exe file before running in windows 64 bit

Upvotes: 1

Kevin W.
Kevin W.

Reputation: 49

I figured it out.

Dim conn, rs

Set conn= createobject("adodb.connection")
set rs = createobject("adodb.recordset")

conn.Open "Driver={Adaptive Server Enterprise}; Server=xxx.xxx.xxx.xxx; port=yyyy; uid=user; pwd=pwd; db=mydatabase;"
rs.open "Select * from blah", conn

Using this you'll be able to use QTP/UFT and connect to a sybase 16 database - so long as you have have the Sybase Adaptive Server Enterprise drivers installed on your system. It's a proprietary database and to my knowledge you'll have to either purchase drivers directly from Sybase or from a thrid party. If you're running Sybase 16 at your company you more than likely have the ASE drivers - ask around.

Upvotes: 1

Related Questions