# 这个 SQL 语法对吗 ?

Posted by kkcheung on June 26, 1998 at 16:08:15:

Private Sub SSCommand1_Click()

Set WS = DBEngine.Workspaces(0)
Set db = WS.OpenDatabase("", False, False, "ODBC;dsn=FMSDATA;database=FMSDB;uid=fms;pwd=fmsfms")
Set rs = db.OpenRecordset("dbo.back_customer")
Set Data1.Recordset = rs
DBGrid1.Visible = True

a = Text1.Text
With tempQueryDef
.SQL = "select * from rs where cust_code = '" & a & "'"
.Execute
End With
End Sub

上面的程式是以TEXT1.TEXT的输入查询有关资料档的客户代号.但 SQL="SELECT * FROM RS WHERE COLUMNA='"& a &"'",好像出错,请问错在那里?谢谢大家.

Follow Ups:

- Re: 这个 SQL 语法对吗 ? 纪文和 00:51:32 6/27/98 (2)
  - Re: 这个 SQL 语法对吗 ? kkcheung 10:24:05 6/27/98 (1)
    - Re: 这个 SQL 语法对吗 ? 纪文和 01:20:07 6/29/98 (0)