An unknown error has occured...
- From: "Karl-Gunnar Hultland" <karl-gunnar.hultland@xxxxxxxxxx>
- Date: Mon, 20 Feb 2006 11:18:02 +0100
I have a problem using the ADO components connectiong to a MS SQL 2000
server.
I use a TADO Dataset and need to insert a new post into that dataset. But
when I execute the code I get an unknown exception on the first and second
line. (Project raised exception class EOleException with message "Ett okänt
fel har uppstått." (An unknown error has occured)
If I select break to get into debug mode I am inside the function
TCustomADODataSet.LocateRecord and on the line
if FieldCount = 1 then
FLookupCursor.Find(GetFilterStr(FieldByName(KeyFields), eyFields), KeyValues,
Partial), 0, adSearchForward, EmptyParam)
if I select continue I get another error and then it all goes through no
problem. I have tried rearranging the statements and always get error on the
firs couple of lines regardless the roder they are in.
My code follows below:
dmSVABPADM.ADOdsBest.Insert;
dmSVABPADM.ADOdsBestFRANVARANDE.AsInteger:=0;
dmSVABPADM.ADOdsBestORSAK.AsInteger:=-1;
dmSVABPADM.ADOdsBestARBETSPLATS.AsString:=PString(cbArbetsplats1.Items.Objects[cbArbetsplats1.ItemIndex])^
;
dmSVABPADM.ADOdsBestARBETSTID.AsInteger:=trunc(frac(dtpEXP***.Time)*1440+0.5)-trunc(frac(dtpEXPStart.Time
)*1440+0.5);
dmSVABPADM.ADOdsBestDATUM.AsDateTime:=int(dtpEXPDatum.Date);
dmSVABPADM.ADOdsBestSTATUS.AsInteger:=0;
dmSVABPADM.ADOdsBestSTARTAR.AsInteger:=trunc(frac(dtpEXPStart.Time)*1440+0.5);
);
dmSVABPADM.ADOdsBestSLUTAR.AsInteger:=trunc(frac(dtpEXPSlut.Time)*1440+0.5);
(removed init of some fields here)
dmSVABPADM.ADOdsBest.Post;
The definition of the table is as follows:
CREATE TABLE dbo.VP_BESTALLNING (
BEST_ID Numeric(18, 0) IDENTITY NOT NULL,
STATUS Int,
DATUM DateTime,
ARBETSPLATS Char(20),
STARTAR Int,
SLUTAR Int,
ARBETSTID Int,
FRANVARANDE Numeric(18, 0),
ORSAK Int,
KOMMENTAR VarChar(200),
ARBETSPASS Numeric(18, 0),
BESTALLARE Numeric(18, 0),
HANDLAGGARE Numeric(18, 0),
KOMP1 Int,
KOMP2 Int,
KOMP3 Int,
KOMP4 Int,
KOMP5 Int,
BEFTYP Int,
BEF Int,
BESTTID DateTime,
CONSTRAINT PK_VP_BESTALLNING PRIMARY KEY CLUSTERED (
BEST_ID
)
) ON "PRIMARY"
GO
--
--
Et in Arcadia Ego - I Tego Arcana Dei
.
- Follow-Ups:
- Re: An unknown error has occured...
- From: Brian Bushay TeamB
- Re: An unknown error has occured...
- From: Steve Zimmelman
- Re: An unknown error has occured...
- Prev by Date: Re: Console app to write to MS Access database
- Next by Date: Re: Parameters in MS Access
- Previous by thread: Console app to write to MS Access database
- Next by thread: Re: An unknown error has occured...
- Index(es):