Главная страница
Top.Mail.Ru    Яндекс.Метрика
Текущий архив: 2003.06.26;
Скачать: 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 вся ветка

Текущий архив: 2003.06.26;
Скачать: CL | DM;

Наверх




Память: 0.47 MB
Время: 0.022 c
8-84469
sergey2
2003-03-09 08:12
2003.06.26
Как выделить конкретный цвет?


14-84592
Empleado
2003-05-27 18:06
2003.06.26
У атеистов могут !


3-83960
Igor
2003-05-29 12:51
2003.06.26
Надо написать запрос.


14-84575
Кен
2003-06-06 02:08
2003.06.26
В Windows найдены секретные API


11-84062
Vit@l
2002-09-26 21:20
2003.06.26
Создание компонента для KOL