Local $_Main_BaoJiaGuangLi_XuHao = 1, $_JiaGe_XuHao = 0, $_DuQu_BaoJiaGuangLi_JiaGe,$_XinZeng_JiaGe=0
$Rs = ObjCreate("ADODB.Recordset")
$Rs.ActiveConnection = $ObjConn
_GUICtrlListView_DeleteAllItems($_LeiBiaoMing_PanDuan)
Sleep(200)
$Rs.Open("Select ID,FenLei,PeiJian,PinPai,XingHao,CanShu,BeiZhu From _Andrew_BaoJiaGuangLi Where DengLu_ID='" & $_BaoJiaGuangLi_ID_PanDuan & "' Order By ID Desc")
While Not $Rs.Eof And Not $Rs.Bof
$Rs1 = ObjCreate("ADODB.Recordset")
$Rs1.ActiveConnection = $ObjConn
$Rs1.Open("Select Top 1 JiaGe From _Andrew_BaoJiaGuangLi_JiaGe Where DengLu_ID='" & $_BaoJiaGuangLi_ID_PanDuan & "' And FenLei_ID='" & $Rs.Fields("ID" ).Value & "' " & _
"Order By FenLei_ID Desc,XuiGaiRiQi Desc")
While Not $Rs1.Eof And Not $Rs1.Bof
$_XinZeng_JiaGe = $Rs1.Fields("JiaGe" ).Value
$Rs1.Movenext
WEnd
$Rs1.Close
GUICtrlCreateListViewItem($Rs.Fields("ID" ).Value & "|" & $_Main_BaoJiaGuangLi_XuHao & "|" & $Rs.Fields("FenLei" ).Value & "|" & $Rs.Fields("PeiJian" & _
"" ).Value & "|" & $Rs.Fields("PinPai" ).Value & "|" & $Rs.Fields("XingHao" ).Value & "|" & $_XinZeng_JiaGe & "|" & $Rs.Fields("CanShu" & _
"" ).Value & "|" & $Rs.Fields("BeiZhu" ).Value, $_LeiBiaoMing_PanDuan)
$_Main_BaoJiaGuangLi_XuHao += 1
$_XinZeng_JiaGe = 0
$Rs.Movenext
WEnd
$Rs.Close
$Rs = ObjCreate("ADODB.Recordset")
$Rs.ActiveConnection = $ObjConn
$Rs.Open($_SuoSou_PanDuan_NengYong1)
While Not $Rs.Eof And Not $Rs.Bof
$ID = $Rs.fields("ID" ).value
$GongSiMingCheng = $Rs.fields("GongSiMingCheng" ).value
$DianHua = $Rs.fields("DianHua" ).value
$QQ = $Rs.fields("QQ" ).value
$DiZhi = $Rs.fields("DiZhi" ).value
GUICtrlCreateListViewItem($ID & "|" & $_SuoSou_i1 & "|" & $GongSiMingCheng & "|" & $DianHua & "|" & $QQ & "|" & $DiZhi, $_Main_ListView_KeHu)
$_SuoSou_i1 += 1
$Rs.Movenext
WEnd
$Rs.Close
我写了一个软件。在本地使用局域网时读写数据库N快。。但是我把数据库丢上公网时。。在客户端使用时。读写数据库会很慢。。差不多一秒才读写完一条数据。。。
我使用的是MSSQL数据库。。。
第一段代码里是同时操作2个数据表的。就会出现我上面说的情况。读写很慢。。
第二段代码里是单一操作一个数据表的。在公网也是N快。。
为什么同时操作2个数据表里读写数据会出现读写很慢的情况呢??
请高手指点一下。。 |