Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Data Bases > Microsoft Access > VBA ODBC Append...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 1 of 1 Topic 30649 of 31573
Post > Topic >>

VBA ODBC Append Query

by Starke <starke1120@[EMAIL PROTECTED] > Jul 3, 2008 at 07:57 PM

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.PRIMPGMCOLLEGE =
'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
 




 1 Posts in Topic:
VBA ODBC Append Query
Starke <starke1120@[EM  2008-07-03 19:57:55 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Mon Dec 1 23:16:20 CST 2008.