远程写SQLServer数据库,突然变慢。急待解决!!!!!!!
用VB在客户端访问远程SQLServer。
用两个连接、两个记录集完成客户端Access数据库和远程SQLServer数据库的数据交换。
一、下载
rsServer.open "select * from 表A",cnServer,....
for i=1 to rsServer.RecordCound
rsClient.open "insert into 表A(字段1,字段2....) values(rsServer!字段1,rsServer!字段2...)",cnClient,....
rsServer.MoveNext
next
二、上传
rsClient.open "select * from 表A",cnClient,....
for i=1 to rsClient.RecordCound
rsServer.open "insert into 表A(字段1,字段2....) values(rsClient!字段1,rsClient!字段2...)",cnServer,....
rsClient.MoveNext
next
以前执行速度很快(正常),上传和下载时间相当。
最近发现通过公网上传时速度突然变的很慢,大约是下载时间的十倍,下载时间仍然正常。在局域网内上传和下载时间还是正常(不受影响)。
我以为是传输方式造成的(上传时是写远程SQLServer数据库),就换了一种方式上传:
rsClient.open"insert into [ODBC;Driver=SQL Server;Server=远程IP;network=dbmsson;Uid=用户名;Pwd=密码;database=数据库名].表A select * from 表A",cnClinet,...
但是,情况并没有改善,上传时间没有明显缩短。
这种情况是什么原因造成?是否是SQLServer2000出了问题?
怎样解决?