Archives of the TeradataForum
Message Posted: Wed, 15 Mar 2006 @ 19:58:35 GMT
Subj: | | Teradata table as record source for Microsoft Acess |
|
From: | | Rob |
Hi
I am trying to use a Teradata table as a source for a Microsoft Access Form using the code below on Form Open. It works but the form just shows
that there should be 28 records (the number of rows on the table) but doesn't display the data or column headings.
Any Ideas what I'm doing wrong?
Private Sub Form_Open(Cancel As Integer)
Dim Conn As New ADODB.Connection
Dim rs As ADODB.Recordset
If Conn.ConnectionString = "" Then
Set Conn = CreateObject("ADODB.Connection.2.7")
Conn.ConnectionTimeout = 0
Conn.CommandTimeout = 0
Conn.Properties("prompt").Value = 3
End If
Conn.Open
Set rs = New ADODB.Recordset
With rs
Set .ActiveConnection = Conn
.Source = "SELECT srt_cde FROM database.tablename"
.LockType = adLockOptimistic
.CursorType = adOpenKeyset
.CursorLocation = adUseClient
.Open
End With
Set Me.Recordset = rs
Set rs = Nothing
Set Conn = Nothing
End Sub
Thanks
Rob
|