sql - Querying data from database with vb6 and ms access with adodb -


i want select , view data in database, it’s proving challenge. advice on missing it? if run code when select criteria met, returns search failed. help?

if txtsun.text = "sun"     set rst = new adodb.recordset     dim ssql string     ssql = "select * sundryproduct prodcont='" & txt_con_code.text & "'"     rst.open ssql, cnn, adopenforwardonly, , adcmdtext     'rst.open "select * sundryproduct prodcont='" & txt_con_code.text & "' ", cnn, adopenforwardonly, , adcmdtext     if rst.eof     msgbox ("search failed")     else     msgbox ("quantity ordered  " & rst!quantityordered & vbcrlf & "   load number   " & rst!loadnumber)     end if end if 

i trying find out if there record matching prodcont value in database, since still trying make code work in first place have put messageboxes in code. have tried putting in actual value know exists in database still returns search failed messagebox though know value exists in database.

if rst.eof = true '----> here   msgbox ("search failed") else   msgbox ("quantity ordered  " & rst!quantityordered & vbcrlf & "   load number   " &  rst!loadnumber) end if 

Comments

Popular posts from this blog

linux - Does gcc have any options to add version info in ELF binary file? -

javascript - Clean way to programmatically use CSS transitions from JS? -

android - send complex objects as post php java -