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

Popular posts from this blog

Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.12:test (default-test) on project.Error occurred in starting fork -

windows - Debug iNetMgr.exe unhandle exception System.Management.Automation.CmdletInvocationException -

configurationsection - activeMq-5.13.3 setup configurations for wildfly 10.0.0 -