Access Automation

Anyone know the syntax to get the Results of a Query in Access back in either Stream or into a Table? I can do it in Excel but never played with Access! Thanks in advanced. Tony

HI Tony, try this declare some variables Name DataType Subtype Length adoConn Automation ‘Microsoft ActiveX Data Objects 2.6 Library’.Connection adoRs Automation ‘Microsoft ActiveX Data Objects Recordset 2.6 Library’.Recordset flds Automation ‘Microsoft ActiveX Data Objects Recordset 2.6 Library’.Fields fld Automation ‘Microsoft ActiveX Data Objects Recordset 2.6 Library’.Field empno Integer empname Text 10 dept Text 10 sql Text 200 write the following code IF NOT VARIABLEACTIVE(adoConn) THEN CREATE(adoConn); //OPEN THE CONNECTION adoconn.Open(‘adodsn’); //OPEN THE RECORDSET rs:=adoconn.Execute(‘select * from Employee’); //TO READ THE FIELD VALUE while not rs.EOF do BEGIN flds:=rs.Fields; fld:=flds.Item(1); message(format(fld.value)); rs.MoveNext; END; //TO INSERT THE RECORD IN MS ACCESS empno:=383; empname:=‘ajay’; dept:=‘IT Development’; sql:=‘insert into Emp(Empno,EmpName,Department) values(’+format(empno) +’,’’+empname+’’,’’+dept+’’)’; adoconn.Execute(sql); //TO EXECUTE A QUERY adoconn.execute(‘qryNAME’);