以下是引用sdta在2023-3-13 21:31:17的发言:
在单机上没问题
PUBLIC nhandle
nhandle=sqlstringconnect("driver=sql server;server=127.0.0.1;uid=sa;pwd=******;database=3D")
*sqlexec(nHandle,"select * from 基础数据 ","本地数据")
sqlexec(nHandle,"select * from 基础数据 where recno()>reccount()-200 ","本地数据")
this.grid1.RecordSource="本地数据"
*headerHeight 抬头高度。Rowheight 就是每行的行高
thisform.pageframe1.page1.grid1.setall("alignment",2,"column")&&内容居中
thisform.pageframe1.page1.grid1.setall("alignment",2,"header")&&表头居中
thisform.pageframe1.page1.grid1.setall("resizable",.f.,"column")&&禁止调整宽度
thisform.pageframe1.page1.grid1.setall("movable",.f.,"column")&&禁止调整列前后
thisform.pageframe1.page1.grid1.columns(1).backcolor=RGB(215,255,215)
thisform.pageframe1.page1.grid1.columns(2).backcolor=RGB(240,248,255)
thisform.pageframe1.page1.grid1.columns(3).backcolor=RGB(240,248,255)
thisform.pageframe1.page1.grid1.columns(4).backcolor=RGB(240,248,255)
thisform.pageframe1.page1.grid1.columns(5).backcolor=RGB(240,248,255)
thisform.pageframe1.page1.grid1.columns(6).fontbold=.t.
thisform.pageframe1.page1.grid1.rowheight=25
thisform.pageframe1.page1.grid1.Columns(1).width=80
thisform.pageframe1.page1.grid1.Columns(2).width=50
thisform.pageframe1.page1.grid1.Columns(3).width=50
thisform.pageframe1.page1.grid1.Columns(4).width=50
thisform.pageframe1.page1.grid1.Columns(5).width=50
thisform.pageframe1.page1.grid1.Columns(6).width=70
thisform.pageframe1.page1.grid1.Columns(7).width=70
thisform.pageframe1.page1.grid1.Columns(8).width=70
thisform.pageframe1.page1.grid1.Columns(9).width=70
thisform.pageframe1.page1.grid1.Columns(10).width=30
thisform.pageframe1.page1.grid1.Columns(11).width=30
thisform.pageframe1.page1.grid1.Columns(12).width=70
thisform.pageframe1.page1.grid1.Columns(13).width=70
thisform.pageframe1.page1.grid1.Columns(14).width=70
thisform.pageframe1.page1.grid1.Columns(15).width=70
thisform.pageframe1.page1.grid1.Columns(16).width=70
thisform.pageframe1.page1.grid1.Columns(17).width=70
thisform.pageframe1.page1.grid1.Columns(18).width=70
thisform.pageframe1.page1.grid1.Columns(19).width=70
thisform.pageframe1.page1.grid1.Columns(20).width=80
thisform.pageframe1.page1.grid1.Columns(21).width=50
thisform.pageframe1.page1.grid1.Columns(22).width=50
报错columns不是一个对象,怎么回事
sqlexec(nHandle,"select * from 基础数据 ","本地数据")
用这句就没问题