第一个问题:不知道你所说的复合查表指什么,是不是要进行表连接罗。。
FROM {<table_source>} [,...n] ]
<table_source> ::=
table_name [ [AS] table_alias ] [ WITH ( <table_hint> [,...n]) ]
| view_name [ [AS] table_alias ]
| rowset_function [ [AS] table_alias ]
| derived_table [AS] table_alias [ (column_alias [,...n] ) ]
| <joined_table><joined_table> ::=
<table_source> <join_type> <table_source> ON <search_condition>
| <table_source> CROSS JOIN <table_source>
| <joined_table>
<join_type> ::=
[ INNER | { { LEFT | RIGHT | FULL } [OUTER] } ]
[ <join_hint> ]
JOIN具体请看tsql的help.第二个问题:
function ReadTestToCombobox(target as combobox)
dim rs as adodb.recordset
rs.open "select test from test","dns=test;uid=sa;pwd=sa",1,3
target.clear
do while not rs.eof
target.additem cstr(rs.Fields(0))
rs.movenext loop
rs.close
set rs=nothing
end function
就是大概是这样了。。最好加一些对NULL和空值的判断
FROM {<table_source>} [,...n] ]
<table_source> ::=
table_name [ [AS] table_alias ] [ WITH ( <table_hint> [,...n]) ]
| view_name [ [AS] table_alias ]
| rowset_function [ [AS] table_alias ]
| derived_table [AS] table_alias [ (column_alias [,...n] ) ]
| <joined_table><joined_table> ::=
<table_source> <join_type> <table_source> ON <search_condition>
| <table_source> CROSS JOIN <table_source>
| <joined_table>
<join_type> ::=
[ INNER | { { LEFT | RIGHT | FULL } [OUTER] } ]
[ <join_hint> ]
JOIN具体请看tsql的help.第二个问题:
function ReadTestToCombobox(target as combobox)
dim rs as adodb.recordset
rs.open "select test from test","dns=test;uid=sa;pwd=sa",1,3
target.clear
do while not rs.eof
target.additem cstr(rs.Fields(0))
rs.movenext loop
rs.close
set rs=nothing
end function
就是大概是这样了。。最好加一些对NULL和空值的判断
我有两个表 depots和Operators,分别取它们的name字段,SQL?如果我要在下拉框下有一个缺省变量是不是把clear变成添加就可以了
"下拉框下有一个缺省变量"? 那时VB的事,直接用 COMBOBOX.TEXT = "DEFAULT..."就行了, 和数据库无关
"但是我经常要同时读好几张表那"? 大部分数据库系统都会同时读很多表