Home Page for the TeradataForum
 

Archives of the TeradataForum

Message Posted: Wed, 15 Mar 2006 @ 19:58:35 GMT


     
  <Prev Next>  
<<First
<Prev
Next>
Last>>
 


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



     
  <Prev Next>  
<<First
<Prev
Next>
Last>>
 
 
 
 
 
 
 
 
 
  
  Top Home Privacy Feedback  
 
 
Copyright for the TeradataForum (TDATA-L), Manta BlueSky    
Copyright 2016 - All Rights Reserved    
Last Modified: 15 Jun 2023