November 21, 201411 yr Newbies Hi, I have an Execute SQL Insert command that needs to run when a user clicks a button on our Custom Web Solution (PHP). The command should write data from my file to an outside user's MS SQL Server. The ODBC Connection to the outside MS SQL Server is set up on our FM 13 Server. The SQL Insert command works when ran manually on the client on the server. Also runs as a scheduled script. But will not work when called from the custom web solution. Code in the PHP page: $assetID = $_POST['assetID']; $newPerformScript =@ $fm->newPerformScriptCommand('Vision_Export', 'web_Push_Data_to_VISION', $assetID ); $result =@ $newPerformScript->execute(); FM Script: Go to Layout ["Export"] Perform Find: IDNum = Get ( ScriptParameter ) // find our record with parameter from web Execute SQL [No Dialog; DSN:Export; Calculated SQL Text: "INSERT INTO tblImport (Field1) VALUES ('10')" (Perform without Dialog) Set Field [Error_Capture; Get (LastODBCError) I know that the script is running and finding the correct record by the ODBC error that is recorded: The Last ODBC Error: [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified Any help would be appreciated. Thanks.
November 21, 201411 yr rather than write with script, get the data from FM and write to MS SQL via PHP.
December 1, 201411 yr Author Newbies Found the fix! Created a sub-script using FM13 new option to PerformScriptOnServer to do the actual SQL insert and it worked. Thanks!
Create an account or sign in to comment