使用存储过程吧。要不一个SQL语句很难实现。

解决方案 »

  1.   

    "insert tresult (fstdno,f) values((select fstdno from tstudent_info where fname='"& request.form("stuname") &"'),"& request.form("stu") &")"
      

  2.   

    错误类型:
    Microsoft OLE DB Provider for ODBC Drivers (0x80040E14)
    [Microsoft][ODBC SQL Server Driver][SQL Server]在此上下文中不允许使用子查询。只允许使用标量表达式。
      

  3.   

    那你就用过程吧!create proc 名
    @stuname varchar(100),
    @stu int
    begin
    insert tresult (fstdno,f) select fstdno,@stu from tstudent_info where fname=@stuname
    end
      

  4.   

    或:"insert tresult (fstdno,f) select fstdno,"& request.form("stu") &" from tstudent_info where fname='"& request.form("stuname") &"'"试试