I need some help transferring information from a recordset that I am retrieving from an AS400 dbase to a newly created table that is in Access. Below is what I have so far but I am stuck right now. Any help would be grrreat.
Sub HELP()
Dim cnt As New ADODB.Connection
Dim rst As New ADODB.Recordset
Dim strSQL As String
Dim strpath As String
Dim strpnum As String
strpnum = "8800463%"
strpath = "DSN=AMES01"
DoCmd.DeleteObject acTable, "MYTABLE"
strSQL = "Create Table MYTABLE" _
& "([Part Number] TEXT(50),[Operation] TEXT(20)," _
& "[Rate]DOUBLE);"
DoCmd.RunSQL strSQL
strSQL = "SELECT MFRFMR02 AS ""Part Number""," & _
" MFRFMR03 AS ""Operation""," & _
" MFRFMR0P AS ""Rate"" FROM DPNEW WHERE(MFRFMR02='8800463')"
cnt.Open (strpath)
Set rst = cnt.Execute(strSQL)
cnt.Close
Set cnt = Nothing
'How do I get the Recordset in to _
the table?
'rst.Close
'Set rst = Nothing
End Sub
Thanks, Rib
Bartender:Hey aren't you that rope I threw out an hour ago?
Rope:No, I'm a frayed knot.
Sub HELP()
Dim cnt As New ADODB.Connection
Dim rst As New ADODB.Recordset
Dim strSQL As String
Dim strpath As String
Dim strpnum As String
strpnum = "8800463%"
strpath = "DSN=AMES01"
DoCmd.DeleteObject acTable, "MYTABLE"
strSQL = "Create Table MYTABLE" _
& "([Part Number] TEXT(50),[Operation] TEXT(20)," _
& "[Rate]DOUBLE);"
DoCmd.RunSQL strSQL
strSQL = "SELECT MFRFMR02 AS ""Part Number""," & _
" MFRFMR03 AS ""Operation""," & _
" MFRFMR0P AS ""Rate"" FROM DPNEW WHERE(MFRFMR02='8800463')"
cnt.Open (strpath)
Set rst = cnt.Execute(strSQL)
cnt.Close
Set cnt = Nothing
'How do I get the Recordset in to _
the table?
'rst.Close
'Set rst = Nothing
End Sub
Thanks, Rib
Bartender:Hey aren't you that rope I threw out an hour ago?
Rope:No, I'm a frayed knot.