VB6 Help

TroubleShooter

Solid State Member
Messages
10
Just want you guys to check what's wrong with ths SQL Code. I was using VB6 and Microsoft Access as the database. I've used a DataGrid to check if there was a result but nothing appears on the datagrid even though I'm very sure that there should have.I didn't have to explain what the code means I'm sure guys will immediately have knowledge of it.

openDB
poproDB.Open "SELECT * FROM payment WHERE pono = ' " & txtPONo & " ' AND cleared = '" & "yes" & "' "

And I'll be definitely be back for more questions cause I'm working on a project. Thanks in advance for your help.
 
I'm going to assume txtPONo is a textbox and not just a variable.

Try:
Code:
poproDB.Open "SELECT * FROM payment WHERE pono = ' " & [B]txtPONo.Text[/B] & "' AND cleared = '" & "yes" & "'"
 
  1. Are you sure that SQL statement is being parsed properly?
  2. Where's the code to actually bind values to the DataGrid or add anything to the DataGrid at all?
  3. How are you storing your recordset?

Me confused.
 
Back
Top Bottom