Hi:
I did copy good sample from your site "faq769-6229' and looked great. However, I got 3 error :
1. odbcConnection not defined.
2. odbcCommand not defined.
3. odbcDataReader not defined.
Iam using MS VB 2008, and it might be because of the VB version.
Could some one help please. The code is below my name.
Thanks
Private Sub AS400Connect()
Dim FirstCenter As String = "426"
Dim LastCenter As String = "444"
'Define the ODBC Connection string
Dim MyODBCConnection As New odbcConnection("Driver={Client Access ODBC Driver (32-bit)};" & _
"System=ARRAKIS;" & _
"TRANSLATE=1;" & _
"Uid=UserID;" & _
"Pwd=User Password")
'Open the connection
MyODBCConnection.Open()
'Define the SQL statement to extract the data from the AS400
Dim SelectCommand As odbcCommand = New odbcCommand("SELECT * FROM ODVFILELIB.MTD02L6 WHERE(MTD02L6.FRFWS >= FirstCenter And MTD02L6.FRFWS <= LastCenter) order by MTD02L6.FRFWS", MyODBCConnection)
Dim dr As OdbcDataReader = SelectCommand.ExecuteReader
Try
'set the mouse to show a wait cursor
Me.Cursor = Cursors.WaitCursor
'Start the reading loop
While dr.Read
Dim TheFrameCode As String
TheFrameCode = dr.getString("1")
End While
Me.Cursor = Cursors.Default
Catch ex As Exception
End Try
End Sub
I did copy good sample from your site "faq769-6229' and looked great. However, I got 3 error :
1. odbcConnection not defined.
2. odbcCommand not defined.
3. odbcDataReader not defined.
Iam using MS VB 2008, and it might be because of the VB version.
Could some one help please. The code is below my name.
Thanks
Private Sub AS400Connect()
Dim FirstCenter As String = "426"
Dim LastCenter As String = "444"
'Define the ODBC Connection string
Dim MyODBCConnection As New odbcConnection("Driver={Client Access ODBC Driver (32-bit)};" & _
"System=ARRAKIS;" & _
"TRANSLATE=1;" & _
"Uid=UserID;" & _
"Pwd=User Password")
'Open the connection
MyODBCConnection.Open()
'Define the SQL statement to extract the data from the AS400
Dim SelectCommand As odbcCommand = New odbcCommand("SELECT * FROM ODVFILELIB.MTD02L6 WHERE(MTD02L6.FRFWS >= FirstCenter And MTD02L6.FRFWS <= LastCenter) order by MTD02L6.FRFWS", MyODBCConnection)
Dim dr As OdbcDataReader = SelectCommand.ExecuteReader
Try
'set the mouse to show a wait cursor
Me.Cursor = Cursors.WaitCursor
'Start the reading loop
While dr.Read
Dim TheFrameCode As String
TheFrameCode = dr.getString("1")
End While
Me.Cursor = Cursors.Default
Catch ex As Exception
End Try
End Sub