Problem using TADOStoredProc with MS Access XP
- From: "Bill N" <billnielsen@xxxxxxxxxxx>
- Date: Sun, 26 Feb 2006 20:56:54 -0500
My TADOStoredProc is executing the first parameter values when I call it
subsequent times. For excample say I pass an integer value of 6 and the
next time I call it, I pass 5. It inserts 6 again.
I have the following query written in Access:
======================================================================
PARAMETERS pEmployeeID Long,
pDefaultDay Text ( 20 ),
pShiftID Long,
pStartTime DateTime,
pEndTime DateTime;
INSERT INTO Emp_Defaults ( EmployeeID, DefaultDay, ShiftID, StartTime,
EndTime )
VALUES (pEmployeeID, pDefaultDay, pShiftID, pStartTime, pEndTime);
======================================================================
I have the following code in Delphi:
======================================================================
//now add the default times
if (Self.chbxMonday.Checked) then
InsertDtl(iNewHireID,'Monday',cbxShftsMon.EditValue,StartTimeMon.Time,EndTimeMon.Time);
if (Self.chbxTues.Checked) then
InsertDtl(iNewHireID,'Tuesday',cbxShftsTues.EditValue,StartTimeTues.Time,EndTimeTues.Time);
//
...
if (Self.chbxSun.Checked) then
InsertDtl(iNewHireID,'Sunday',cbxShftsSun.EditValue,StartTimeSun.Time,EndTimeSun.Time);
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
procedure TfrmNewHire.InsertDtl(const EmpID: Integer; const DefDay: string;
const ShftID: Integer; const StTime, EndTime: TTime);
begin
with spInsertDefShifts do
begin
Parameters[0].Value := EmpID;
Parameters[1].Value := DefDay;
Parameters[2].Value := ShftID;
Parameters[3].Value := StTime;
Parameters[4].Value := EndTime;
ExecProc;
end;
end;
======================================================================
The TADOStoredProc is defined as :
---------------------------------------------------------------------------------------------------------
object spInsertDefShifts: TADOStoredProc
ProcedureName = 'qryInsertDefShifts'
Parameters = <
item
Name = 'pEmployeeID'
DataType = ftInteger
Size = 8
Value = Null
end
item
Name = 'pDefaultDay'
DataType = ftString
Size = 20
Value = Null
end
item
Name = 'pShiftID'
DataType = ftInteger
Size = 8
Value = Null
end
item
Name = 'pStartTime'
DataType = ftDateTime
Size = 8
Value = Null
end
item
Name = 'pEndTime'
DataType = ftDateTime
Size = 8
Value = Null
end>
Left = 556
Top = 184
end
---------------------------------------------------------------------------------------------------------
Am I missing something? Anyone know why the procedure continues to hold the
parameter values from the first time it is called?
Thanks,
Bill N
.
- Prev by Date: FileMaker database files very slow
- Next by Date: Re: Betterado error in Delphi 2006
- Previous by thread: FileMaker database files very slow
- Next by thread: Re: Problem using TADOStoredProc with MS Access XP
- Index(es):
Relevant Pages
|