为什么说我的内存不够?

wanghua00 2002-11-17 09:48:13
我用的BDE的数据库,程序先在数据库中查询是否有这个图号,然后再添加,那知道每次运行到有59条时,就说没有足够的内存,但我的机子有512M内存,要怎么解决???
...全文
25 8 打赏 收藏 转发到动态 举报
写回复
用AI写文章
8 条回复
切换为时间正序
请发表友善的回复…
发表回复
blueshu 2002-11-18
  • 打赏
  • 举报
回复
贴代码
sun_cathay 2002-11-18
  • 打赏
  • 举报
回复
你不要这个窗体重新另作一个肯定就行了
dxz_pl 2002-11-18
  • 打赏
  • 举报
回复
内存不够多半是构造了什么东西忘了free了
wanghua00 2002-11-18
  • 打赏
  • 举报
回复
procedure TForm1.Button3Click(Sender: TObject);
var
excelApp:variant;
filename:string;
Count, count_table:Integer;
Test_End_str,ID_str:String;
i,j,len:Integer;
Temp_str,Temp_str1,Temp_str2,Temp_str3,str:String;
fornt_str:string;
... .....//调用EXECL部分
count:=2;
Test_end_str:=ExcelApp.Cells[Count,1].value;

While(Test_end_str<>'end') do
Begin
Temp_str1:=EXcelApp.Cells.Item[count,4].value; //get the darwing_no
Temp_str2:=EXcelApp.Cells.Item[count,2].value; //get the parts_id
Temp_str2:=EXcelApp.Cells.Item[count,6].value; //get the color_falg


SetLengTh(fornt_str,3);
Fornt_str[1]:=Temp_str1[1];
Fornt_str[2]:=Temp_str1[2];
Fornt_str[3]:=Temp_str1[3];
Query1.Close;
Query1.SQL.Clear;


Query1.SQL.Add('SELECT * FROM PARTS WHERE DRAWING_NO LIKE :STR1');
Query1.ParamByName('str1').AsString:=temp_str1;
Query1.Prepare;
Query1.ExecSQL;

Query1.UnPrepare;

Count_table:=Query1.RecordCount;
if(Count_table=0)Then
Begin
Query1.Close;
Query1.SQL.Clear;
Query1.SQL.Add('SELECT * FROM PARTS WHERE DRAWING_NO LIKE :STR1');
Query1.ParamByName('str1').AsString:=fornt_str;
Query1.Prepare;
Query1.ExecSQL;
Query1.UnPrepare;

Query1.Active:=true;
Count_table:=Query1.RecordCount;



Query1.Close;
Query1.SQL.Clear;
Query1.SQL.Add('INSERT INTO PARTS(ID,DRAWING_NO,DRAWING_SIZE,');
qUERY1.SQL.Add('PARTS_CHINESE_NAME,COLOR_FALG,COLOR_NAME ) ');
Query1.SQL.Add('values(:ID_STR,:DRAWING_NO_STR,:DRAWING_SIZE_STR,');
qUERY1.SQL.Add(':PARTS_CHINESE_NAME_STR,:COLOR_FALG_STR,:COLOR_NAME_stR )');

Query1.ParamByName('Id_str').AsString:=CreateID(fornt_str,count_table);

Str:=ExcelApp.Cells[count,4].value;
Query1.ParamByName('drawing_no_str').AsString:=str;

...............下面是和上面一样的.添加其他项

Query1.Prepare;
Query1.ExecSQL
Query1.UnPrepare;
QUERY1.EXEXCSQL

count:=count+1;

Test_end_str:=ExcelApp.Cells[Count,1].value;
End;







wanderung 2002-11-17
  • 打赏
  • 举报
回复
可能是数据库设置的原因


不过也有可能是病毒的缘故
brallow 2002-11-17
  • 打赏
  • 举报
回复
把具体一点的程序帖上来,看看
Venda 2002-11-17
  • 打赏
  • 举报
回复
Up!
wanghua00 2002-11-17
  • 打赏
  • 举报
回复
我加上QUERY1。PREPARE和QUERY1。UNPREPARE程序又可以增加到118条了

2,495

社区成员

发帖
与我相关
我的任务
社区描述
Delphi 数据库相关
社区管理员
  • 数据库相关社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧