Skip to main content
Participating Frequently
November 15, 2010
Question

Cfexecute and Access 2007

  • November 15, 2010
  • 3 replies
  • 1725 views

Hello All,

I am having trouble with some cf code.  Any help would be appreciated.

Here is my code:

<cfexecute name="C:\WINDOWS\system32\cmd.exe" arguments=" /c C:\inetpub\wwwroot\gisweb\mmd.bat" timeout="100"></cfexecute>

In the following batch file I have put line numbers just to help.  They are not in real file.  Here is the batch file it is calling:

1  "C:\Program Files (x86)\Microsoft Office\Office12\MSACCESS.exe" "D:\Data\SEDCAccess\NNPPDintegrator.mdb" /x Missed_Meters_Daily

2  REM Mapguide Missed Meters Daily to spatial SQLite

3  del /f /q "D:\Data\SEDCAccess\mmd.db"

4  "C:\Program Files (x86)\FWTools2.4.7\bin\ogr2ogr" -f "SQLITE" -dsco  FORMAT=WKB "D:\Data\SEDCAccess\mmd.db" "D:\Data\SEDCAccess\mmd.vrt"

5  REM SQLITE VIEW TO SHP
6  del /f /q "D:\Data\ShapeFiles\missedmd.dbf"
7  del /f /q "D:\Data\ShapeFiles\missedmd.idx"
8  del /f /q "D:\Data\ShapeFiles\missedmd.shp"
9  del /f /q "D:\Data\ShapeFiles\missedmd.shx"

10  "C:\Program Files (x86)\FWTools2.4.7\bin\ogr2ogr" -f "ESRI Shapefile" "D:\Data\ShapeFiles" "D:\Data\SEDCAccess\mmd.db"

The cfexecute works fine when I have line 1 rem'ed out.  It calls the batch file, and executes lines 2-10.  The whole batch file also runs fine when I run it from it's folder.

I can see under processes that cfexecute has started up and MSACCESS.EXE*32 under the administrator account, but it just hangs.

I am running this on a server 2008 64 bit machine with IIS7 installed.

It does not want to run the MSACCESS.EXE portion.  It seems to choke on it everytime.  Anyway to debug this, see what is going on behind the scene?  Any suggestions?

This topic has been closed for replies.

3 replies

peelseel2Author
Participating Frequently
November 18, 2010

Well, we kinda figured it out.  The macro that we where calling in the Access DB was a make table query into another Access DB.  We changed the query to a make table query into the same DB and it worked.

peelseel2Author
Participating Frequently
November 16, 2010

It appears to be some security issue.  I replicated the problem using psexec and getting into a remote interactive command prompt.  Trying the same batch file, which works fine locally, when I run it remotely it spawns the access process but nothing happens, just like what happens with cfexecute.

Inspiring
November 16, 2010

You might investigate using the PsExec tool to execute batch files on a remote computer.  Note that I have not used this with CFEXECUTE.

http://technet.microsoft.com/en-us/sysinternals/bb897553.aspx

peelseel2Author
Participating Frequently
November 16, 2010

I investigated it to use it instead of cfexecute, but since it is displaying the same behavior as cfexecute, I

think it is a security issue on the server and nothing to do with psexec or cfexecute.

Inspiring
November 15, 2010

Things to check:

Does the Windows account that the CF server runs as have rights to:

1. Read/write the file D:\Data\SEDCAccess\NNPPDintegrator.mdb?

2. Execute the C:\Program Files (x86)\Microsoft Office\Office12\MSACCESS.exe program?

Inspiring
November 15, 2010

Also is there any potential UI interaction that Access is expecting that CF can't negotiate, like some sort of dialogue being shown, which - whwn you run the batch file - you handle yourself (by clicking on something, etc).

Also it looks like the Access process itself generates some files.  Does the login you're using have permissions to do that (as you're saying it's starting as an admin user, I am guessing probably "yes").

--

Adam