Hi,
Please check this page for script to import from database.
https://www.originlab.com/doc/LabTalk/examples/general-Import#Import_from_Included_Sample_Access_Database
To loop over each workbook, please refer to this page:
https://www.originlab.com/doc/LabTalk/ref/Document-cmd#-e_object_.7Bscript.7D.3B_Execute_the_given_script_for_all_objects
Sample script can look like this:
Doc -e W
{
string strdb$ = system.path.program$ +
"Samples\Import and Export\stars.mdb";
string strConn$="Provider=Microsoft.Jet.OLEDB.4.0;
Data Source=%(strdb$); User ID=; Password=;";
// The SQL
string strSQL$="SELECT Stars.Index, Stars.Name, Stars.LightYears, Stars.Magnitude
FROM Stars
WHERE Stars.LightYears<=100
ORDER BY Stars.Magnitude, Stars.LightYears";
// Connect database and submit the SQL
dbEdit change conn:=strConn$ sql:=strSQL$;
// Import data
dbImport;
// Disconnect the database
dbEdit remove;
}
James