用cursoradapter 类生成的cursor,,brow可以看到.Grid 怎么获取不到?
用cursoradapter 类生成的cursor,,brow可以看到.Grid 怎么获取不到?程序代码:
oForm = Createobject("form1") oForm.Show Read Events Define Class form1 As Form Caption = "CursorAdapter类示例" Name = "Form1" Add Object grid1 As Grid With ; Anchor = 15, ; Height = 229, ; Left = 6, ; Top = 12, ; Width = 361, ; Name = "Grid1" Procedure Load lo = Createobject("caODBC") Browse Endproc Procedure Init This.grid1.RecordSource = "客户" This.grid1.RecordSourceType = 1 Endproc Procedure Destroy Clear Events Endproc Enddefine Define Class caodbc As CursorAdapter Height = 22 Width = 23 Alias = "客户" BufferModeOverride = 5 DataSourceType = "ODBC" Name = "caodbc" Procedure Init Local lcConnStr, lnConn lcConnStr = "Driver=SQL Server;Server=(local);DATABASE=Northwind;uid=sa;pwd=" lnConn = Sqlstringconnect(lcConnStr) If lnConn > 0 Then This.Datasource = lnConn This.SelectCmd = "SELECT * FROM Customers" This.CursorFill() Else Messagebox("连接失败!") Endif Endproc Procedure Destroy If This.Datasource > 0 Then SQLDisconnect(This.Datasource) Endif Endproc Enddefine
[此贴子已经被作者于2016-3-1 18:56编辑过]