Hello All,
I have made connection to an AS400, Now, what need to do is to get the information from a Table called PRODUCIDAS which is at the Database CEQYXXX and APPEND the data from the table PRODUCIDAS into an ACCESS TABLE
When I run this application it gives me the following message box error:
40002
S0002: [IBM][iSeries Access ODBC Driver][DB2 UDB]SQL0204-HFA_DATA in CEQYXXX type *FILE not found
CODE
Option Explicit
Dim mConn As rdoConnection
Private Sub Form_Load()
On Error GoTo procerror
Dim sConn As String
If OpenConnection() Then
MsgBox "connection has been made"
Call MuestraDatos ' SUB to download information from the AS400
Else
MsgBox "Connection has failed"
End If
procexit:
Exit Sub
procerror:
MsgBox Err.Number & vbCrLf & Err.Description
Resume procexit
End Sub
Private Function OpenConnection() As Boolean
On Error GoTo procerror
Dim sConnect As String
Set mConn = rdoEnvironments(0).OpenConnection("SERVER")
OpenConnection = True
procexit:
Exit Function
procerror:
OpenConnection = False
Resume procexit
End Function
Private Sub MuestraDatos()
Dim sqlHFA As String
Dim rsHFA As rdoResultset
Dim myoLocalDBF as Databasse
Dim myLocalRS as Recordset
set myLocalDBF = EngineDB.Workspace(0).Opendatabase("C:\ODBC_GC_DATA\GC_HFA.MDB")
set myLocalRS = HFA_Data ' Table to APPEND records to
sqlHFA = " INSERT INTO HFA_Data (FIELD_1, FIELD_2, FIELD3.....)
" SELECT FIELD_1, FIELD_2, FIELD_3....and so on FROM PRODUCIDAS"
Set rsHFA = mConn.OpenResultset(sqlHFA, rdOpenForwardOnly, rdConcurReadOnly, rdExecDirect)
End Sub