Public Function ConnectString() _
   As String
   ConnectString = "server=(local);user id=sa;Trusted_Connection=true;Database=Student;"
End Function

解决方案 »

  1.   

    ConnectString = "server=(local);user id=sa;Trusted_Connection=true;Database=Student;"
    //表明是SQL的验证是与windows集成验证推荐看看
    http://www.connectionstrings.com/
      

  2.   

    你可以用ADO控件线连接,然后把那个字符串拷贝出来就可以了
      

  3.   

    用一下ADO连接可能更方便
    conn.ConnectionString = "provider=sqloledb.1;data source=" _
      & local & ";initial catalog=" & database & ";uid=" sa ";pwd=" & PassWord