升级到MS SQL Server2000有问题,SOS!!!!(100分)

  • 主题发起人 主题发起人 yansh
  • 开始时间 开始时间
Y

yansh

Unregistered / Unconfirmed
GUEST, unregistred user!
问题是这样的:
系统采用ADO连接SQL库,使用Query对数据库进行操作。原来在SQL Server 7.0下一切正常。近日把数据库升级到MS SQL Server2000简体中文个人版,发生对数据库的操作时发生如下错误:

Project dyedit2000.exe Raised Exception class EoleException with message ‘BOF 或 EOF中有一个是“真”,或者当前记录已被删除,所需的操作要求一个当前的记录。’。Process stopped.use step or Run to Continue。

query.close; ///程序第一次执行到这里没问题,第二次到这里就出错。

这是为什么?请各位大侠指点迷津,拿出解决方案。
 
以上的错误提示应该是Delphi5的ADOExpress没有升级的错误提示,你试着将Delphi的ADO
升级后再编译一下,看看是否还有错误。
 
我的ADO已经升级了。问题可能不是在这里。
我的代码如下
with DataModule1.YC_ADOquery1 do
begin
sqlstr:='';
// if dataModule1.YC_ADOQuery1.Active then
// dataModule1.YC_ADOQuery1.First ;
// else
DataModule1.YC_ADOquery1.Close;
SQL.Clear;
sqlstr:=('select P_RTU_ADD,P_ZINDEX,P_MAN,P_M_VALUE,p_bf,p_nm from dy_yc ');
// sqlstr:=sqlstr+ format(' where p_nm=''%s'' ',[apic.pic_YC.prop.YCVar ]);
sql.Add(sqlstr);
sql.Add('Where P_TYPE=''遥测''');
prepared;
try
open ;
except
execsql;

end;
count:=0;
if DataModule1.YC_ADOquery1.RecordCount>0 then
if DataModule1.YC_ADOquery1.RecordCount<512{256} then
begin
while DataModule1.yc_ADOQuery1.eof<>true do
begin
fyc_dian_info[count].zh:=fields[0].AsInteger;
fyc_dian_info[count].dh:=fields[1].AsInteger;
fyc_dian_info[count].fp_man:=fields[2].AsInteger;
fyc_dian_info[count].fp_m_value:=fields[3].AsFloat;
fyc_dian_info[count].fp_bf:=fields[4].AsFloat;
fyc_dian_info[count].fp_nm:=fields[5].Asstring;
count:=count+1;
DataModule1.yc_ADOQuery1.next;
end;
end;
end;//with
{ TODO : 有错误需要修改爹日调用时出错 }
with DataModule1.YC_ADOquery1 do
begin
sqlstr:='';
// dataModule1.YC_ADOQuery1.First ;//加上这一行可以通过
DataModule1.YC_ADOquery1.Close;//到这里出错
SQL.Clear;
sqlstr:=('select P_RTU_ADD,P_ZINDEX,P_MAN,P_M_VALUE,p_bf,p_nm from dy_yc ');
// sqlstr:=sqlstr+ format(' where p_nm=''%s'' ',[apic.pic_YC.prop.YCVar ]);
sql.Add(sqlstr);
sql.Add('Where P_TYPE=''电度''');
prepared;
try
open ;
except
execsql;

end;
count:=0;
if DataModule1.YC_ADOquery1.RecordCount>0 then
if DataModule1.YC_ADOquery1.RecordCount<256 then
begin
while DataModule1.yc_ADOQuery1.eof<>true do
begin
fdd_dian_info[count].zh:=fields[0].AsInteger;
fdd_dian_info[count].dh:=fields[1].AsInteger;
fdd_dian_info[count].fp_man:=fields[2].AsInteger;
fdd_dian_info[count].fp_m_value:=fields[3].AsFloat;
fdd_dian_info[count].fp_bf:=fields[4].AsFloat;
fdd_dian_info[count].fp_nm:=fields[5].Asstring;
count:=count+1;
DataModule1.yc_ADOQuery1.next;
end;
end;
end;//with
 
是不是跟内存漏洞有关,你的fyc_dian_info和fdd_dian_info的结构数组,下标定义是从
0开始的吗?
 
是从0开始的,愿闻其详
 
你贴出的代码也没有什么明显的错误。
 
对呀,我怀疑是SQL2000的问题,因为我在7。0下一切正常。
 
ADO对SqlServer2000的支持不行,而对7.0很好,在SqlServer 2000中李维推荐用ODBC
 
呵呵,你怎么导入你的数据库,是从7。0移过来的么?
 
Delphi 5 Enterprise Update Pack 1 + Delphi 5 ADO Update Pack 2
后就没问题了
 
================================================
DELPHI 5 ADOExpress UPDATE PACK 2
Release Notes
================================================

This update resolves issues with the ADO
features in the Enterprise version of Delphi 5,
as well as in the ADOExpress upgrade to Delphi 5
Professional.

The update is a self-extracting, self-executing
file. Because it refreshes the ADO files in your
current installation, Delphi must be closed
before running the update.


================================================
REQUIREMENTS

Delphi 5, Enterprise version
------------------------------
* Update Pack 1

Delphi 5, Professional version
with the ADOExpress upgrade
------------------------------
* ADOExpress for Delphi 5 Professional,
Update Pack 1
* Delphi 5 Professional, Update Pack 1


================================================
ISSUES RESOLVED IN THIS UPDATE

MDAC 2.6 Compatibility
------------------------------

This update corrects a known issue which affects
certain ADOExpress applications when running
against MDAC 2.6. Most commonly, the following
error is generated when closing an empty dataset:
"Either EOF or BOF is True, or the current record
has been deleted. Requested operation requires a
current record". The same error may also occur
when canceling an edit operation. Affected
applications should be recompiled after the
update is installed.


================================================
HELP UPDATES

Help updates are available at:
http://www.borland.com/techpubs/delphi


================================================
Copyright ?2000 Inprise Corporation.
All rights reserved.

 
那里有ADO升级包的下载,解决后分分。
 
http://www.borland.com/devsupport/delphi/mdac26.html
ftp://ftpc.inprise.com/pub/delphi/devsupport/updates/adoexpress/d5adoupdate2.exe
 
打两个补丁就可以了

这个问题我也遇到了,极度历险和INPRISE可以找到呀~~
 
靠,晚了,已经有人说了,呵呵
 
delphi 80 问题已经解决多谢
ht99 5
redwin 5
Tyzhang 10 第一个回答的鼓励一下
 
另一问题也是100分

http://www.delphibbs.com/delphibbs/dispq.asp?lid=574735
 
后退
顶部