请教rds的问题!!
本人正在使用rds,但是无论是自己写的vb程序,还是在网页上嵌入activx,均不能成功.(连从iis的产品文档copy下来的例子也不能幸免)好像每次rds.recordset都是空的...不知道是何原因.
这是本人程序的代码:
Dim rs As ADOR.Recordset
Dim adc As RDS.DataControl
Private Sub Command1_Click()
Set adc = New RDS.DataControl
adc.Server = Text1.Text
adc.Connect = Text2.Text
adc.SQL = Text3.Text
adc.ExecuteOptions = adcExecAsync
adc.FetchOptions = adcFetchBackground
adc.Refresh
While adc.ReadyState <> adcReadyStateComplete And adc.ReadyState <> ad
cReadyStateInteractive
DoEvents
Wend
Command1.Enabled = False
Set rs = adc.Recordset(其值为nothing,应该是没有成功得到数据吧)
If rs.State = adStateClosed Then
MsgBox "can not read data!!", vbInformation
Else
rs.MoveNext
Text4.Text = rs.Fields(1)
End If
Command1.Enabled = True
End Sub