Connecting Tech Pros Worldwide Help | Site Map

VBA ODBC Append Query

 
LinkBack Thread Tools Search this Thread
  #1  
Old July 4th, 2008, 03:05 AM
Starke
Guest
 
Posts: n/a
Default VBA ODBC Append Query

I have the below code, and i need to append the results to a local
table called "tblUserInfo" . The local table, tblUserInfo has the
same data structure as the results. But not sure how to append the
results to that table. Here is my code.


Private Sub cmdFetch_Click()


''' Setup DB connection
Dim cnn As ADODB.Connection
Dim rst As ADODB.Recordset

Set cnn = New ADODB.Connection
Set rst = New ADODB.Recordset


''' Clean up user input
strBiuser = Trim(Me.txtBIQryUserName)
strBiPass = Trim(Me.txtBiQryPassword)

'''Setup Connection to BI-Qry
cnn.Open "PANSY1", strBiuser, strBiPass
rst.ActiveConnection = cnn
rst.CursorLocation = adUseServer


'''Set Query for BI-Qry
rst.Source = "select SEAM_VIEWS_LSA.SEAM_STUDENTPRIMARY.STUDENTID,
SEAM_VIEWS_LSA.SEAM_STUDENTPRIMARY.LASTNAME, " _
& "SEAM_VIEWS_LSA.SEAM_STUDENTPRIMARY.FIRSTNAME,
SEAM_VIEWS_LSA.SEAM_STUDENTPRIMARY.USERNAME " _
& "from SEAM_VIEWS_LSA.SEAM_STUDENTTERM,
SEAM_VIEWS_LSA.SEAM_STUDENTPRIMARY where " _
& "((SEAM_VIEWS_LSA.SEAM_STUDENTTERM.PRIMPGMCOLL EGE =
'22') and (SEAM_VIEWS_LSA.SEAM_STUDENTTERM.TERM = '08U')) " _
& "and SEAM_VIEWS_LSA.SEAM_STUDENTTERM.STUDENTID =
SEAM_VIEWS_LSA.SEAM_STUDENTPRIMARY.STUDENTID ;"



rst.Open
rst.Close

Set rst = Nothing
Set cnn = Nothing
End Sub

 

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Popular Articles

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over 220,840 network members.