错误内容类似:
"Access violation read address 0000000, read of address ffffffff"环境:
BDE联接paradox表,中文表名,中文字段使用query Close;
Unprepare;
DatabaseName := DataPath;
SQL.Clear;
SQL.ADD('Select 编码 From 客户编码 Where 编码='''+cCode+'''');
Prepared := True;
ExecSQL;
Open;发生错误。
"Access violation read address 0000000, read of address ffffffff"环境:
BDE联接paradox表,中文表名,中文字段使用query Close;
Unprepare;
DatabaseName := DataPath;
SQL.Clear;
SQL.ADD('Select 编码 From 客户编码 Where 编码='''+cCode+'''');
Prepared := True;
ExecSQL;
Open;发生错误。
解决方案 »
- 关于图像截取问题image1上的图像如何取得左边部分呢?在线等
- ChildForm如何显示在mdi窗口的panel上?
- ReportBuilder中怎样实现背景图案?
- 急急急!Delphi中是否有计算时间间隔的函数,类似VB中的DateDiff?
- 用什么组件连接ACCESS数据库比较好
- 请问有关 窗体最小化时 显示为托盘图标的问题
- 这些语句不懂,请帮助!
- 20分钟内结帐,字符串问题。。。
- 如何访问Access数据库
- 请问在没装office的情况下,如何用ADO连接Access数据库(不用ODBC)
- 请问、如何用delphi自代的压缩单元,将一些自定义的数据写入压缩文件,最重要的是不影响解压缩之后的数据,高分相送。
- 帮忙解决一下
Close;
SQL.Clear;
SQL.ADD('Select 编码 From 客户编码 Where 编码='''+cCode+'''');
//ExecSQL;//不能用与open操作
Open;
而且你没有用parameter,没有什么必要prepare
Unprepare;
DatabaseName := DataPath;
SQL.Clear;
SQL.ADD('Select 编码 From 客户编码 Where 编码='''+cCode+'''');
Prepared := True;
Open;//这和SELECT合用,对于不用返回结果集的(INSERT ,UPDATE)用EXECSQL
DatabaseName := DataPath;
SQL.Clear;
SQL.ADD('Select 编码 From 客户编码 Where 编码='''+cCode+'''');
Open;这样我也用过,还是错的。
用
SQL.ADD('Select 编码 From 客户编码 Where 编码=''+cCode+''');
出错
用
SQL.ADD('Select 编码 From 客户编码 Where 编码=:cCode');
出错
再换成QUERY
with query do
begin
Close;
SQL.Clear;
SQL.ADD('Select 编码 From 客户编码 Where 编码='''+cCode+'''');
Open;
end;
begin
Close;
SQL.Clear;
SQL.ADD('Select cHelpCode From vClient');
Open;
First;
While Not Eof Do
begin
cHelpCode := FieldByName('cHelpCode').AsString;
With SysDataModule.QueryClient Do
begin
Close;
DatabaseName := DataPath;
SQL.Clear;
SQL.ADD('Select 编码 From 客户编码 Where 编码='''+cHelpCode+'''');
Open;
////////////错误在这里
First;
If Eof Then //加入数据
Begin
With SysDataModule.TableClient Do
begin
Close;
Open;
Edit;
Append;
FieldByName('编码').AsString := SysDataModule.QueryDrpClient.FieldByName('cHelpCode').AsString;
Post;
n := n + 1;
Close;
end;
end; //加入数据
close;
end;
m:=m+1;
Next;
end;
Close;
end;
Unprepare;
DatabaseName := DataPath;
SQL.Clear;
SQL.ADD('Select 编码 From 客户编码 Where 编码='''+cCode+'''');
Prepared := True;
Open;
insert, delete, update-----ExecSQL