Posted by NC on 09/09/05 19:02
jsw_nz wrote:
>
> I am trying to run an agent application that converts and imports two
> tables from MS Access into mySql.
> (Intelligent Converters - Access2mySql)
> I have run similar scripts to do mysql dumps using the system function.
> Not sure if the paths included in the parameters are correct:
>
> <?php
> function import_data() {
> $sourceFile = "C:\Program Files\Intelligent converters\myAccessDB.mdb";
> $tableFile = "C:\Program Files\Intelligent Converters\whichTables.txt";
> system("/Program Files/Intelligent Converters/A2SAGENT.EXE
> --dest=st_staff --src=$sourceFile --tab_file=$tableFile --mode=1");
> }
> import_data();
> ?>
>
> This syntax works fine in command line prompt, but somehow it is not
> working when called from php.
It's possible your system doesn't like the space in the command line.
It's also possible that the \'s in variables are treated as escape
symbols.
Try this:
$sourceFile = '"C:\Program Files\Intelligent
converters\myAccessDB.mdb"';
$tableFile = '"C:\Program Files\Intelligent
Converters\whichTables.txt"';
$cl = '"/Program Files/Intelligent Converters/A2SAGENT.EXE" ' .
"--dest=st_staff --src=$sourceFile --tab_file=$tableFile
--mode=1";
system($cl);
Cheers,
NC
[Back to original message]
|