Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Connection to teradata server through ASP code

Status
Not open for further replies.

crazylad

Programmer
Dec 26, 2003
8
IN
I want to fetch data from a table which resides on teradata server through ASP code.
I am using V2R4.1 version of teradata and 3.0 version of ASP.

I would appreciate if somebody could provide me with some sample ASP codes which makes teradata database connection and execute query.

Thanks
 
Hi,

We're using a OLE DB connection to connect to the database.

<%
var conntemp = new ActiveXObject('ADODB.Connection');
conntemp.Open (&quot;File Name=c:\\plato.udl&quot;);
%>

where plato.udl is the name of the udl file which holds the connection info (ip number, user,password etc)

Then
<%
//SqlStr contains the sql query

SqlStr=&quot;sel country_id from plato.content&quot;

//We execute the SqlStr and put it in a rowset

Var rs=conntemp.execute(SqlStr);

// Next thing is we write the results on screen, till the end of the recordset

while(!rs.eof){
Response.Write rs('country_id')
rs.moveNext();
}
rs.close;



Hope this helps... Btw, this example is written in javascript

 
Thanks for your help but I am still not able to connect to the database .
Can you please send me the content of connection file which you have stored in you local drive.

I am using theses parameters.
&quot;Provider=Teradata;&quot; & _
&quot;DBCName=;&quot; & _
&quot;Database=;&quot; & _
&quot;Uid=;&quot; & _
&quot;Pwd=&quot;

here does DBCName means the ODBC connection name or the server name where teradata resides. Other information is pretty clear

Thanks
 
Before we connected to teradata through OLE DB we used ODBC, and the connection string was:

var conntemp=server.createobject(&quot;adodb.connection&quot;)
conntemp.open &quot;DSN=teradataweb; uid=***; pwd=***&quot;;

DSN is the name of the ODBC connection you made in the windows ODBC controlpanel...
That's all we needed to connect, so I don't know what those other parameters are..

We'll have to wait for dnoeth or tdatagod to clear this up I guess... :)

Anyway, the contents of the UDL file are:


Provider=TDOLEDB.1;Password=***;Persist Security Info=True;User ID=****;Data Source=***.***.***.***

Data Source is the IPnumber of the teradata machine..


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top