Dim myHWSETConn,myHWSETCommand,HWSETRS
HWsetSelection = val(HWsetSelection)
Const DB_CONNECT_STRING1 = "Provider=SQLOLEDB.1;Data Source=FWATRGSQLVCL2;Initial Catalog=Cal1;user id ='Caluser';password='caluser'"
Set myHWSETConn = CreateObject("ADODB.Connection")
Set myHWSETCommand = CreateObject("ADODB.Command" )
myHWSETConn.Open DB_CONNECT_STRING1
Set myHWSETCommand.ActiveConnection = myHWSETConn
myHWSETCommand.CommandText = "SELECT [hw_fullname] FROM [Cal].[dbo].[Req_Simple] where Fwid= "&HWsetSelection&" "
Set HWSETRS = myHWSETCommand.Execute
我有这段代码可以从SQL中获取值,但是我尝试将其置于下拉菜单时遇到了困难
call NewHwset.Items.Add(HWSETRS)
但是它说,键入不匹配的“ NewHwset.Items.Add”
我们非常感谢您的帮助, 谢谢。