I have written the following code for insert data to navision tabel from access and encountering the following error.
Error "the datatype is not supported by C/SIDE You can Access data From anyone of the following datatypes VT_VOID,VT_I2,VT_I4,.....VT_BOOL".
Variables//
varRecordSet Automation 'Microsoft ActiveX Data Objects Recordset 2.8 Library'.Recordset
varFldCollection Automation 'Microsoft ActiveX Data Objects Recordset 2.8 Library'.Fields
RecordVar RecordRef
FieldVar FieldRef
Constr Text 1024
StrSql Text 1024
i Integer
Code://
Constr := 'Provider=Microsoft.Jet.OLEDB.4.0; Data Source=C:\Access To Navision\Amantest.mdb;' +
'User Id=admin; Password=;';
StrSql := 'Select EmpCode, EmpName, EmpSalary, DOB From Employee';
CREATE(varRecordSet);
varRecordSet.Open(StrSql, Constr);
varRecordSet.MoveFirst;
RecordVar.OPEN(50001);
REPEAT
varFldCollection := varRecordSet.Fields;
RecordVar.RESET;
RecordVar.INIT;
FOR i := 1 TO RecordVar.FIELDCOUNT DO BEGIN
FieldVar := RecordVar.FIELDINDEX(i);
FieldVar.VALIDATE(varFldCollection.Item(i-1).Value);
END;
RecordVar.INSERT;
varRecordSet.MoveNext
UNTIL varRecordSet.EOF = TRUE;
varRecordSet.Close;
RecordVar.CLOSE;
CLEAR(varRecordSet);
CLEAR(RecordVar);
](*,)
Aman Kumar Gupta
0
Comments
viewtopic.php?t=28720
viewtopic.php?t=28702
So, now to your problem.
1. Where do you establish the ADOConnection?
2. Where does this error pops up (wich line)? This info is very helpful ;-)
3. ADO is very, very easy, search to forum, there are many posts.
Here a simple example
Thanks