Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

Professional Opinions
Ask a Question
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE

troubleshooting Question

error on sql selection from as400 using visual basic

Avatar of MVLIS
MVLISFlag for United States of America asked on
IBM System iMicrosoft DevelopmentSQL
3 Comments1 Solution501 ViewsLast Modified:
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.
Avatar of Gary Patterson, CISSP
Gary Patterson, CISSPFlag of United States of America imageExpert for hire: IBM i, AIX, Linux, Windows, DB2, Performance, Security. EDI

Our community of experts have been thoroughly vetted for their expertise and industry experience.

This problem has been solved!
Unlock 1 Answer and 3 Comments.
See Answers