怎么发现都不会去用搜索功能呢?这类型的代码应该很多的,我记得我都发过好几次了.今天先给你,以后先自己搜一下再问?
Dim res,cmd,sql
Set Res=createobject("adodb.recordset")
Set Cmd=createobject("adodb.command")
Cmd.activeconnection="Provider=SQLOLEDB.1;Password=111111;Persist Security Info=True;User ID=sa;Initial Catalog=xhq;Data Source=192.168.191.142"数据源要修改
Cmd.CommandType = 1
sql="select name from company where (id=1)"
Cmd.CommandText = sql
Set res = Cmd.Execute()
Set res = nothing
Set cmd.ActiveConnection = nothing
Set Cmd= nothing