Jump to content

Execute SQL command not working from Custom Web Solution


megbrown77
 Share

This topic is 2923 days old. Please don't post here. Open a new topic instead.

Recommended Posts

  • 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 [email protected] $fm->newPerformScriptCommand('Vision_Export', 'web_Push_Data_to_VISION', $assetID );

$result [email protected] $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.

 

Link to comment
Share on other sites

  • 2 weeks later...

This topic is 2923 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.