General discussion
October 23, 2006 at 05:25 AM
472955

Visual Basic: Connect to a teradata database from VB

by 472955 . Updated 19 years, 9 months ago

Hi all!!!
I am quite new in Visual-Basic and i am trying to establish a connection with a Database Teradata (using an ODBC connection), my code es the following:
———————————————
Dim qdfTemp As QueryDef
Dim rstTemp As Recordset
Dim dbs_cls_tbug As Database

Set dbs_cls_tbug = OpenDatabase(“dwht1”, False, False, “ODBC;DSN=dwht1;PWD=ex0n3”)

Set qdfTemp = dbs_cls_tbug.CreateQueryDef(“”)
qdfTemp.sql = “select * from inc_sas_tbug”

qdfTemp.ReturnsRecords = True

With qdfTemp

‘open recordset from queryDef
Set rstTemp = .OpenRecordset()

With rstTemp
………..
…….
………
End With

End With
….

——————————————–
when the execution tries to execute the line:
Set rstTemp = .OpenRecordset(), i receive an exception with no number…
i am trying to do it since almost two weeks and i don’t know what else i can try 🙁
but i think the problem is on the connection although the exception is when i open the recordset
if someone could help me, i would be very happy.

thanks
laura

This discussion is locked

All Comments