Archives of the TeradataForum
Message Posted: Tue, 19 Nov 2002 @ 18:16:26 GMT
Subj: | | Re: Web page(s) accessing Teradata. |
|
From: | | Bryan |
Jim,
Here's an example of how its done with Visual Basic 6.0. I imagine the same thing could be applied to .net, though I've never tried.
The connection string properties can be adjusted to suit your needs. This code fills a listbox or combobox (must be below 32767 records)
with data elements obtained from the line:
Set rs = adoConnectionTeradata.Execute ("SQL Code").
The "SQL Code" area is a nice place to execute macros on Teradata, rather than write all your SQL code in VB, especially if you have
variables you want to pass from your Web page.
Dim adoConnectionTeradata As ADODB.Connection
Dim connectStringTeradata As String
Dim rs As ADODB.Recordset
Set adoConnectionTeradata = New ADODB.Connection
connectStringTeradata = "Provider=MSDASQL.1;Persist Security Info=False;" &_
"Extended Properties
=""DRIVER={Teradata};UID=" ";" & _
"PASSWORD=" ";DBCNAME=;DATABASE=;"""
adoConnectionTeradata.Open connectStringTeradata, ,
Set rs = adoConnectionTeradata.Execute ("SQL Code")
rs.MoveFirst
Do Until rsCliID.EOF
< any form >.< any listbox or combobox >.AddItem rs!< data element in record set >
rs.MoveNext
Loop
|