list database and related table in Teradata with vb6

Connectivity
N/A

list database and related table in Teradata with vb6

How to, is possible?

tks.

2 REPLIES
N/A

Re: list database and related table in Teradata with vb6

SORRY FOR UP...:-)

Re: list database and related table in Teradata with vb6

Yes it is possible. All you need to do is put your query in the code after connecting. I took one sample code( I dont have env to test and you have to make changes accordingly if need be) from net and paste here. 

Query is : SELECT databasename,tablename from dbc.tables

Dim cnt As ADODB.Connection 

Dim rst As ADODB.Recordset 

Dim stSQL As String 

Dim StCon as String 

Const stCon As String = "DSN=xxx;Uid=' " & ccccc & " '; Pwd' " & zzzzz & "';" 

Set cnt = New ADODB.Connection 

Set rst = New ADODB.Recordset 

cnt.ConnectionString = stCon 

cnt.Open 

stSQL = "SELECT databasename,tablename from dbc.tables" 

rst.Open stSQL, cnt, adOpenDynamic, adLockReadOnly 

if rst.recordcount > 0 or not rst.eof then 

rst.MoveFirst 

do while not rs.eof 

.......

rst.movenext 

loop 

rst.Close 

cnt.Close 

Hope it helps.