我做了一个学生管理系统,我想按学号来查询这个学生的所有信息,这个语句怎么写啊,请大侠指点了,谢谢了。写个代码最好了/

解决方案 »

  1.   

    select * from 学生表 where 学号='001'楼主连这个也不会怎么做系统?还是先学好基础吧!
      

  2.   

    是不是要写一个do while    loop 的循环语句啊!!
      

  3.   

    你的问题是如何学会使用 ADO 或 DAO 对象及控件,真正将 SQL 语句得以执行。在另一个帖子里给你例子代码了。
      

  4.   

    如果你的对SQL语句不理解我劝你还是好好看看书吧!不然你会很郁闷
      

  5.   

    ADO:
    1.数据库连接
        Dim ValConnect As String
        
        With ADODB_Source
            If .State = 1 Then
                .Close
            End If
            .ConnectionTimeout = 60
            .Provider = "MSDAORA.1"
            .ConnectionString = "Data Source=" & strDataSource & ";Password=" & strPwd & ";User ID=" & strUID
            .CursorLocation = adUseClient
            .Open
        End With2.查询数据
        dim strSQL$
        dim rsTemp as ADODB.Recordset
        
        strSQL="select * from 学生表 where 学号='001'"
        set rsTemp = ADODB_Source.execute(strSQL)
        with rsTemp 
             .movefirst
             if .Recordcount > 0 then
                '这里写你的代码            .movenext
             end if
        end with
      

  6.   

    with rsTemp 
             if .Recordcount > 0 then
                .movefirst
                '这里写你的代码
                for i = 1 to .Recordcount 
                     '********
                     '********
                     .movenext
                next i
             end if
        end with