Getting General run Error while opening connection for teradata using UFT(error number :-2147467259)

Database
Enthusiast

Getting General run Error while opening connection for teradata using UFT(error number :-2147467259)

Hi All,

I am facing the General error while opening the connection for teradata using UFT tool Version 12.2 Scripting language is vbscript. Please find the below code.

Please help me to resolve this issue. Thanks in Advance.

 

first I have created ODBC connection (C:\Windows\SysWOW64\odbcad32.exe) for Teradata and DSN name is "DSNTeradata" then write uft code (i.e. vbscript code) for execute query for teradata

------UFT Code---

Set cnDatabase = CreateObject("ADODB.Connection")

cnDatabase.CommandTimeOut=600000

'Below is connection string

cnDatabase.ConnectionString="Data Source=DSNTeradata;Database=myDB;Persist Security Info=True;User Id=Tester1;Password=tester123;Session Mode=ANSI;"

'Below line for Open the connection then throw the error as 'General run error'

cnDatabase.Open

Set ObjRecSetData = cnDatabase.Execute("select * from logtable")

------Code end-------

When cnDatabase.Open command run then throwing "General run error" Error number is :-2147467259.

Please let me know what is wrong in my code. please help

Thanks,

Pradeep

10 REPLIES
Teradata Employee

Re: Getting General run Error while opening connection for teradata using UFT(error number :-2147467

That looks more like an ADO .NET connection string. For ADODB I would expect something like

"DSN=DSNTeradata;UID=Tester1;PWD=tester123;SessionMode=ANSI;"

Enthusiast

Re: Getting General run Error while opening connection for teradata using UFT(error number :-2147467

Thanks Fred for acknowledge on my query.

I have tried the "DSN=DSNTeradata;UID=Tester1;PWD=tester123;SessionMode=ANSI;" this connection string but have the same issue. I meant "General run error".

Do you have any alternative soultion for my above issue?

Teradata Employee

Re: Getting General run Error while opening connection for teradata using UFT(error number :-2147467

That error number indicates that the ConnectionString is not valid. Try explicitly stating Provider=MSDASQL; at the beginning of the connection string (that's the ADO provider / bridge for ODBC). In 32-bit environments MSDASQL is the default, but I don't think 64-bit environments have a default. 

Enthusiast

Re: Getting General run Error while opening connection for teradata using UFT(error number :-2147467

Hi Fred,

I have trired your soulution, I meant add the "Provider=MSDASQL;" at the beginning of the connection string two ways.

Option1 vbscript code:

Set cnDatabase=CreateObject("ADODB.Connection")

cnDatabase.CursorLocation=3  '3-adUseClient , 2-adUseServer

cnDatabase.ConnectionString="Provider=MSDASQL;DSN=DSNTeraData;UID=Tester1;PWD=tester123;SessionMode=ANSI;'

cnDatabase.Open

Get the same error, "General run error"

Option2 vbscript code:

Set cnDatabase=CreateObject("ADODB.Connection")

cnDatabase.CursorLocation=3  '3-adUseClient , 2-adUseServer

cnDatabase.ConnectionString="Provider=MSDASQL;Data Source=DSNTeraData;Persist Security Info=True;User Id=Tester1;Password=tester123;Session Mode=ANSI;'

cnDatabase.Open

Get the error as, "Multiple-step OLE DB operation generated errors. Check each OLE DB status value. if available. No work was done. "cnDatabse.Open"

I'm sure that the data source name and driver are specified correctly. Could there be any another reason for anove both errors?

Please acknowledge.

Thank You,

Regards,

Pradeep Patil

Teradata Employee

Re: Getting General run Error while opening connection for teradata using UFT(error number :-2147467

One other thing worth trying: Explicitly set the Provider property for the connection object, instead of including it in the connection string:

 

cnDatabase.Provider="MSDASQL"   'or try MSDASQL.1

cnDatabase.ConnectionString="DSN=DSNTeraData;UID=Tester1;PWD=tester123;SessionMode=ANSI;"

cnDatabase.Open

Enthusiast

Re: Getting General run Error while opening connection for teradata using UFT(error number :-2147467

Hi,

I have tried the below proposed options but have the same isse. Attached screen shot the same.

Option1

cnDatabase.Provider="MSDASQL" 

cnDatabase.ConnectionString="DSN=DSNTeraData;UID=Tester1;PWD=tester123;SessionMode=ANSI;"

cnDatabase.Open

Option 2  

cnDatabase.Provider="MSDASQL.1" 

cnDatabase.ConnectionString="DSN=DSNTeraData;UID=Tester1;PWD=tester123;SessionMode=ANSI;"

cnDatabase.Open

Fred, can let me know How I can verify Teradata ODBC driver correctly installed on my machine. Please acknowledge.

Note: My OS version is Windows 7 Enterprise 64 bit.

Thanks,

Pradeep Patil

Teradata Employee

Re: Getting General run Error while opening connection for teradata using UFT(error number :-2147467

For 64-bit Windows there should be a 64-bit test program tdxodbc.exe in \Program Files\Teradata\Client\vv.mm\bin folder and a 32-bit version in \Program Files (x86)\...

Open a command prompt corresponding to the same "bit-ness" as your UFT. Run the tdxodbc program and it should prompt you for DSN, UID, PWD values and then let you enter a SQL statement such as "SELECT * FROM DBC.DBCInfoV".

 

But if the error is still -2147467259 (x'80004005') then the failure most likely occurs before the Provider even attempts to invoke the ODBC driver. You'll probably need to get advice from someone who knows more about Microsoft ADO and/or the UFT tool. 

Enthusiast

Re: Getting General run Error while opening connection for teradata using UFT(error number :-2147467

Hi Team,

Please acknowlede on my recent post, I meant in below post.

Thank You,

Regards,

Pradeep Patil


@Pradeep_Patil wrote:

Hi,

I have tried the below proposed options but have the same isse. Attached screen shot the same.

Option1

cnDatabase.Provider="MSDASQL" 

cnDatabase.ConnectionString="DSN=DSNTeraData;UID=Tester1;PWD=tester123;SessionMode=ANSI;"

cnDatabase.Open

Option 2  

cnDatabase.Provider="MSDASQL.1" 

cnDatabase.ConnectionString="DSN=DSNTeraData;UID=Tester1;PWD=tester123;SessionMode=ANSI;"

cnDatabase.Open

Fred, can let me know How I can verify Teradata ODBC driver correctly installed on my machine. Please acknowledge.

Note: My OS version is Windows 7 Enterprise 64 bit.

Thanks,

Pradeep Patil


 

Highlighted
Teradata Employee

Re: Getting General run Error while opening connection for teradata using UFT(error number :-2147467

You may need to get help from someone with more knowledge about Microsoft ADO or the UFT tool in particular. Microsoft's explanation for error -2147467259 implies that it has not even tried to invoke the TD ODBC driver yet.

 

To verify your ODBC setup:

There should be a tdxodbc.exe command-line test program in the \Program Files\Teradata\Client\xx.yy\bin folder. (For 64-bit systems, there should also be a 32-bit version in \Program Files (x86)\...) Execute that program and it will prompt for the DSN, Username, and Password. (The password will not display.)