4200 - SQL0104 - Token was not valid

June 2024 ยท 1 minute read

ERROR [42000] [IBM][System i Access ODBC Driver][DB2 for i5/OS]SQL0104 - Token ( was not valid. Valid tokens: FOR USE SKIP WAIT WITH FETCH ORDER UNION EXCEPT OPTIMIZE.

This is My Code, I want to display the Table Records to Data Grid View in VB from AS400

Sub ShowAS400() Call takeconnectionas400() conn.Close() conn.Open() adapter = New OdbcDataAdapter("select * from PYLEAVE (PTMIFLIB)", conn) ds = New DataSet adapter.Fill(ds, "PYLEAVE (PTMIFLIB)") DGVAS400.DataSource = ds.Tables("PYLEAVE (PTMIFLIB)") DGVAS400.ReadOnly = True End Sub 
1

1 Answer

try to modify your query like this

 select * from PTMIFLIB.PYLEAVE 

or like this

 select * from PTMIFLIB/PYLEAVE 
0

ncG1vNJzZmirpJawrLvVnqmfpJ%2Bse6S7zGiorp2jqbawutJoa2lqY2Z%2Bcn%2BObWlpaF2ovq18kGlrZqyfoLKvedaaqmamn6l6t63Lops%3D