Skip to Main Content

DevOps, CI/CD and Automation

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

ODBC access from HTA script fails

JL HainsworthMar 10 2009 — edited Mar 10 2009
I am trying to connect to Oracle via ADO from a HTA(HTML Application) script.

I have trying both DSN and DSNLESS connections, see code below.

I have also tried the Microsoft ODBC for Oracle, Oracle 9i ODBC and Oracle10g ODBC drivers.

I have tried doing the connection from both vbscript and javascript.

Everything I try gives me the "[Microsoft][ODBC Driver Manager} Driver's SQLSetConnectAttr failed" error.

Any help will be greatly appreciated!

*** CODE ***

<script Language="JavaScript"><!--

function dotheconnectionx()
{
var sConnect="DSN=prod2;UID=tts;PWD=tts";

var objConnx= new ActiveXObject( "ADODB.Connection" );
objConnx.Open( sConnect );
alert(objConnx.errors.count);
alert(objConnx.errors(0).description);
}
//--></script>

<script language="vbscript">

Dim objConn
Dim rsetQuery
Dim tmpSQL
Dim tmpDSN
tmpDSN="DSN=prod2;uid=tts;pwd=tts"
Dim strConn
strConn="Driver={Microsoft ODBC for Oracle}; CONNECTSTRING=prod; uid=TTS; pwd=tts;"

sub dotheconnection
Set objConn = CreateObject("ADODB.Connection")
objConn.ConnectionString = tmpDSN
objConn.Open
If objConn.errors.count <> 0 Then
alert(objConn.errors.count)
alert("problem connecting to the database")
alert(objConn.errors(0).description)
alert(objConn.ConnectionString)
end if
end sub

</script>

<body onload="dotheconnection();">
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Apr 7 2009
Added on Mar 10 2009
2 comments
4,395 views