Вниз
Скачать: CL | DM;

DataBaseError -    Найти похожие ветки 

 
Инна   (2003-06-03 18:09) [0]

две хп на сервере
1. СREATE PROCEDURE correctlec;1
@gr int, @dis int, @color int, @prepod int
AS
SET NOCOUNT ON
declare @potok int
set @potok =(select code_of_potok from groups where ID=@gr)
declare curs cursor local scroll read_only
for select ID from groups where code_of_potok=@potok
open curs
fetch first from curs into @gr
while @@fetch_status = 0
begin
if not exists (select * from lection where code_of_group=@gr and code_of_dis=@dis and color=@color)
insert into lection (code_of_group, code_of_dis, color, code_of_prepod)
values (@gr, @dis, @color, @prepod )
else
update lection set code_of_prepod=@prepod where code_of_group=@gr and code_of_dis=@dis and color=@color
fetch next from curs into @gr
end
close curs
deallocate curs
GO


2 - CREATE PROCEDURE correctlec2;1
@gr int, @dis int, @color int, @hours int
AS
SET NOCOUNT ON
declare @potok int
set @potok =(select code_of_potok from groups where ID=@gr)
declare curs cursor local scroll read_only
for select ID from groups where code_of_potok=@potok
open curs
fetch first from curs into @gr
while @@fetch_status = 0
begin
if not exists (select * from lection where code_of_group=@gr and code_of_dis=@dis and color=@color)
insert into lection (code_of_group, code_of_dis, color, hours)
values (@gr, @dis, @color, @hours )
else
update lection set hours=@hours where code_of_group=@gr and code_of_dis=@dis and color=@color
fetch next from curs into @gr
end
close curs
deallocate curs
GO

из проги определяется абсолютно одинаково:
1 - correct3.Parameters.ParamByName("@gr").Value:=group;
correct3.Parameters.ParamByName("@dis").Value:=ADODataSet1.FieldByName("code_of_dis").AsInteger;
correct3.Parameters.ParamByName("@color").Value:=1;
correct3.Parameters.ParamByName("@prepod").Value:=p1;
correct3.Execute;

2- correct4.Parameters.ParamByName("@hours").Value:=edit_l_h.Text;
correct4.Parameters.ParamByName("@dis").Value:=ADODataSet1.FieldByName("code_of_dis").AsInteger;
correct4.Parameters.ParamByName("@color").Value:=1;
correct4.Parameters.ParamByName("@gr").Value:=group;
correct4.Execute;


первая проходит отлично, вторая никакие парметры не находит (в проге меняла местами). почему? может, вы увидите, я уже не вижу.....


 
Zelius ©   (2003-06-03 18:42) [1]

А попробуй перед присвоением параметров поставить что-то типа correct4.Parameters.Refresh;



Страницы: 1 вся ветка

Скачать: CL | DM;



Память: 0.45 MB
Время: 0.019 c
14-84581
Пубертанец
2003-06-03 17:06
2003.06.26
Где достать реально работающий flexcel?


1-84115
mao
2003-06-10 15:43
2003.06.26
Некрасивое мерцание формы :(


1-84156
lipskiy
2003-06-08 02:20
2003.06.26
Запуск программы с параметром.


1-84084
kah68
2003-06-10 12:39
2003.06.26
Не обязательный параметр


14-84514
Leonid
2003-06-03 13:19
2003.06.26
Надо решить пару задач на Delphi - 10$




   Наверх