为什么 我使用
dim XDBH as string
SQL = "select * from 资料  where ID = " & XDBH & "" 可以成功连接数据库
 而使用
Public OnID As String
dim XDBH as string
OnID = " where ID = " & XDBH & ""
SQL = "select * from 资料 " & OnID
就失败,显示 " where ID = " 错误