发表于:2004-01-05 10:28:00
楼主
iFix中定义
Dim cnn As ADODB.Connection
Dim rs As ADODB.Recordset
Dim sql As String
Dim ConnectionString As String
Set cnn = New ADODB.Connection
Set rs = New ADODB.Recordset
cnn.CursorLocation = adUseClient
cnn.ConnectionString = "driver={SQL Server};" & _
"server=127.0.0.1;uid=sa;pwd=shang;database=gas_data"
cnn.Open
sql = "select * from Unit_Info"
rs.CursorType = adOpenKeyset
rs.LockType = adLockOptimistic
rs.Open sql, cnn, adOpenDynamic
后提示不能识别未定义的类型,然后我加入Miscrosoft ADO Control组件,再运行还是不行,但是在VB中却可以,不知道为什么?请各位大侠指点。。