28. Februar 2013 09:08
ADOConn.Open(ConnStr);
CREATE(ADOrs);
ADOrs.Open('SELECT * FROM ' + SourceTableName, ADOConn, OpenMethod, LockMethod);
IF NOT ADOrs.EOF THEN
BEGIN
ADOrs.MoveFirst;
REPEAT
RecRef.OPEN(TargetTableNo);
FOR i := 1 TO RecRef.FIELDCOUNT DO BEGIN
FldRef := RecRef.FIELDINDEX(i);
Fieldname := CONVERTSTR(FldRef.CAPTION, '.', '_'); // Replace . with _
CASE FORMAT(FldRef.TYPE) OF
// Boolean Values
'Boolean': BEGIN
FldRef.VALUE := ADOrs.Fields.Item(Fieldname).Value;
END;
// Date Values
'Date': BEGIN
EVALUATE(DateTemp, FORMAT(ADOrs.Fields.Item(Fieldname).Value));
FldRef.VALUE := DateTemp;
END;
// Time Values
'Time': BEGIN
EVALUATE(TimeTemp, FORMAT(ADOrs.Fields.Item(Fieldname).Value));
FldRef.VALUE := TimeTemp;
END;
// Option Values
'Option': BEGIN
IntTemp := TextToOptionValue(FORMAT(ADOrs.Fields.Item(Fieldname).Value),
FldRef.OPTIONCAPTION);
FldRef.VALUE := IntTemp;
END;
ELSE BEGIN
IF FORMAT(ADOrs.Fields.Item(Fieldname).ActualSize) <> FORMAT(0) THEN
FldRef.VALUE := FORMAT(ADOrs.Fields.Item(Fieldname).Value);
END;
END;
END;
28. Februar 2013 10:06
28. Februar 2013 10:23
28. Februar 2013 10:31
28. Februar 2013 10:38
28. Februar 2013 10:39
28. Februar 2013 10:48
28. Februar 2013 11:05
28. Februar 2013 11:11
28. Februar 2013 11:20
28. Februar 2013 12:00
beno hat geschrieben:Die Ursprungsdatenbank ist native, die Zieldatenbank ist SQL.
28. Februar 2013 16:03
// Time Values
'Time': BEGIN
EVALUATE(TimeTemp,COPYSTR(TextToTime(Fieldname),12,8));
FldRef.VALUE := TimeTemp;
END;
TextToTime(FieldnameL : Text[200]) FieldValueL : Text[30]
IF ISCLEAR(ADOStream) THEN
CREATE(ADOStream);
ADOStream.Open;
ADOStream.WriteText(ADOrs.Fields.Item(FieldnameL).Value);
ADOStream.Position := 0;
FieldValueL := FORMAT(ADOStream.ReadText);
ADOStream.Close;
CLEAR(ADOStream);
EXIT(FieldValueL);