二楼大哥,按照你的方法我试着写了一下,但是还是在报错,不知道为什么,请指教。
这个是我写的,你看那错了:Dim sql_Ywfw As String
Dim con_Str As New ADODB.Connection
con_Str.ConnectionString = "provider=SQLOLEDB.1;persist security info = false;user id =sa;initial catalog=yangfei"
Dim rs_Ywfw As ADODB.Recordset
sql_Ywfw = "select distinct userID from userinfo"
If rs_Ywfw.State <> adStateClosed Then rs_Ywfw.Close
rs_Ywfw.CursorLocation = adUseClient
rs_Ywfw.Open sql_Ywfw, con_Str
rs_Ywfw.MoveFirst
Do While Not rs_Ywfw.EOF
Combo1.AddItem rs_Ywfw.Fields("userID")
rs_Ywfw.MoveNext
Loop
图片附件: 游客没有浏览图片的权限,请
登录 或
注册