Adodc.RecordSet?
Dim sql As String
AdodcSL.ConnectionString = "Provider=SQLOLEDB.1;Persist Security Info=False;User ID=sa;Pass Word=sa;Initial Catalog=lgdd;Data Source=LIU "
sql = "Select distinct DW_DWM From GX "
AdodcSL.RecordSource = sql
AdodcSL.Recordset.MoveFirst '??? 为什么运行到这就出错?说对象变量或with 块变量未设置。
Do While Not AdodcSL.Recordset.EOF
Combo2.AddItem AdodcSL.Recordset.Fields(0)
AdodcSL.Recordset.MoveNext
Loop
Combo2.Text = AdodcGCSCL.Recordset.Fields(0)
On Error GoTo AddErrGCSCL
AdodcGCSCL.Recordset.AddNew
Exit Sub
AddErrGCSCL:
MsgBox Err.Description
我这个Adodc控件AdodcSL 没有邦定任何控件。
[解决办法]
你检查一下有没有with
AdodcSL.Recordset.MoveFirst 你把这句话删掉会怎样?
[解决办法]
sql = "Select distinct DW_DWM From GX "> > > sql = "Select distinct , DW_DWM From GX "
if AdodcSL.Recordset.RecordCount> 0 then AdodcSL.Recordset.MoveFirst
[解决办法]
感觉你好象没open,??
[解决办法]
貌似是这么查询的
dim rs as RecordSet
Set rs= server.CreateObject( "adodb.recordset ")
rs.open sql, m_conn, 1, 3