Главная страница
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.027 c
7-84767
keymaster
2003-04-16 18:21
2003.06.26
Как запустить ScreenSaver?


3-83994
DNK
2003-05-30 13:18
2003.06.26
Параметры с одинаковыми именами (ADO)


4-84854
Demon[DZ]
2003-04-22 14:48
2003.06.26
Кнопка


3-84020
WinAmp
2003-05-30 21:07
2003.06.26
Индекс не дает редактировать данные в таблице?! :-(


14-84746
Карелин Артем
2003-06-04 16:53
2003.06.26
Где найти женщину с квартирой?