十万火急请问大虾:
如何实现在DELPHI中对SQL2000数据库中的记录进行自动累加,以及数据追加后的排序问题,现在数据库已经存在数据。
万分谢谢
如何实现在DELPHI中对SQL2000数据库中的记录进行自动累加,以及数据追加后的排序问题,现在数据库已经存在数据。
万分谢谢
解决方案 »
- C中的switch到delphi中的case的问题
- 有二月十号南京到西安的卧铺火车票一张,谁要!!!
- 关于读取txt文件
- 为什么ADOConnection不能连接到远程主机上
- 我的感情问题,大家来给点意见(严肃的)
- 请问在delphi中,把一个窗口变成一个图标放在任务栏右角上,要用到什么函数。
- 请教
- create MDI子窗体的问题
- 语音技术请教
- 谁知道PostMessage(AHandle, WM_USER, 0, 0);是干什么用的?
- 在线等待-50分 SQLConnection在连接远程SQL数据库的时候,那些连接信息必须在设计时指定吗?
- Error creating form:Invalid stream format.
create procedure xxx (@maxno integer output)
as
begin
select @maxno=maxno from crno
update crno set maxno=maxno+1;
end返回一个参数给客户段delphi把@maxno和年份合起来插入数据库,可以保证多客户端不产生冲突
我的一个数据库需要自动产生一个数值,也就是类似与学生管理系统中的学号,我在输入一个学生的
姓名后,他自动能够产生一个学号,列如:200400001 200400002 然后将他添加到我已经作好的数据中去,这样在查询的过程中我就可以按学号查询了,数据库中有一个名为学号的字段名称。数据库为SQL 非常谢谢关注
procedure Tpurin03.po01AfterInsert(DataSet: TDataSet);
var now:SYSTEMTIME;
s,sm:string;
i,j,q:integer;
begin
getLocalTime(now);
ADOQuery1.Close ;
ADOQuery1.SQL.Clear ;
ADOQuery1.SQL.Add('select max(poID) from po01 ');
ADOQuery1.open;
sm:=inttostr(now.wMonth);
if length(sm)=1 then sm:='0'+sm;
if ADOQuery1.fields[0].AsString<>'' then
begin
if sm=copy(ADOQuery1.fields[0].AsString,6,2) then
begin
s:=copy(ADOQuery1.fields[0].AsString,8,3);
q:=strtoint(s)+1;
i:=3-length(inttostr(q));
s:=inttostr(q);
for j:=1 to i do
begin
s:='0'+s;
end;
po01.Fields.FieldByName('poID').Asstring :='PO-'+copy(inttostr(now.wYear),3,2)+sm+s;
end else
po01.Fields.FieldByName('poID').Asstring :='PO-'+copy(inttostr(now.wYear),3,2)+sm+'001';
end else
begin
po01.Fields.FieldByName('poID').Asstring :='PO-'+copy(inttostr(now.wYear),3,2)+sm+'001';
end;
end;