sql - Displaying selected values only in VB6 -
i trying display students in datagrid have "yes" active. if student has "no" active, form has hide , show students "yes". problem recieving
syntax error in clause.
code:
private sub form_load() dim sql string connsearch.open connstr adodc1.connectionstring = conn.connstr sql = "select * table1 active <>" & "'no'" adodc1.recordsource = sql set studenttable.datasource = adodc1 adodc1.refresh adodc1.visible = false end sub
what active
?
if active
boolean
data type (yes/no), it's optional values true
or false
. in case query is:
"select * table1 active <> false"
if active
string
data type; 'no'
, 'no'
same values? better converting lower or upper case:
"select * table1 ucase(active) <> 'no'"
edit: modified code
dim sql string sql = "select * table1 [active] <> 'no'" adodc1.connectionstring = conn.connstr adodc1.commandtype = adcmdtext adodc1.recordsource = sql set studenttable.datasource = adodc1 adodc1.refresh adodc1.visible = false
Comments
Post a Comment