MVLIS
asked on
error on sql selection from as400 using visual basic
Dim selectCMD As Odbc.OdbcCommand = New Odbc.OdbcCommand("SELECT M$EMIT FROM KSEDTALIB.M$MEMP WHERE M$EMID = " & Engine & "", MyODBCConnection)
'Initialize the reader
Dim dr As Odbc.OdbcDataReader = selectCMD.ExecuteReader
when I change WHERE M$EMID = 'FXT00VA00097' it works and selects the right statement
but when I define Engine = "FXT00VA00097" and put WHERE M$EMID = " & Engine & "",
it gives the error
ERROR [42S22][IBM][iSeries Access ODBC Driver][DB2 UDB]SQL 0206 - Column FXT00VA00097
not in specified tables
I have to use a variable for the data selection. any help would be appreciated.
'Initialize the reader
Dim dr As Odbc.OdbcDataReader = selectCMD.ExecuteReader
when I change WHERE M$EMID = 'FXT00VA00097' it works and selects the right statement
but when I define Engine = "FXT00VA00097" and put WHERE M$EMID = " & Engine & "",
it gives the error
ERROR [42S22][IBM][iSeries Access ODBC Driver][DB2 UDB]SQL 0206 - Column FXT00VA00097
not in specified tables
I have to use a variable for the data selection. any help would be appreciated.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
thank you very much.
http://msdn.microsoft.com/en-us/library/system.data.odbc.odbcparameter.aspx