I have a DB2 column with auto_increment, namely "PO_NO".
I want to know how to Select a record based on Autoincrement field.
selectquery = SELECT * from TBLPO where PO_NO = " + CSTR(inputPO.Text) + "
here inputPO.Text is a textbox in VB form.
On Excute statement, It gives me an ODBC error as [Microsoft][ODBC dBase Driver] Unexpected error from external database driver (9986).
while if I runthe same query with a Numeric field, it works fine.
Please let me know how can I search on the BASIS of Autoincrement field.
Thank you very much.
I feel your code should be
selectquery = "SELECT * from TBLPO where PO_NO = " & CStr(inputPO.Text) & ""
or try this
selectquery = "SELECT * from TBLPO where PO_NO = '" & CStr(inputPO.Text) & "'"
since auto increment is a numeric/number/integer field, hence the first option should work. In the field I also feel that Cstr is not required as it is already in a text box which means its been treated as a text.
I also have question how come a the error returned has "dBase Driver"? Is't the driver for ODBC for Db2?