Hello,
I am using Coldfusion to call a .vbs file that creates a Powerpoint file using information it pulls from a database. It doesn’t work. Here is the code I am using to execute the .vbs file:
-------------------------------------------------------------------------------
<cfexecute name="C:\WINDOWS\system32\cscript.exe"
arguments="#rootDirectory#\testing.vbs"
outputfile="#docsDirectory#\error.log">
</cfexecute>
-------------------------------------------------------------------------------
I am not sure why the powerpoint file isn’t being generated, but the powerpoint file is generated when I comment out this code (code in the .vbs file):
-------------------------------------------------------------------------------
objConn.Open "DSN=wrd;UID=wrd_user;Password=********"
-------------------------------------------------------------------------------
Here is some more of the code from the .vbs file:
-------------------------------------------------------------------------------
Dim rootDirectory
rootDirectory = "D:\pma"
'Used for recordset object
Dim objConn, objRS
' Define constants from ADOVBS.INC
Const adOpenKeyset = 1
Const adLockOptimistic = 3
Const adCmdText = &H0001
' Create and setup connection object
Set objConn = Server.CreateObject("ADODB.Connection")
objConn.Open "DSN=wrd;UID=wrd_user;Password=********"
Set ppt = CreateObject("Powerpoint.Application")
ppt.Visible = True
ppt.Presentations.Open rootDirectory & "\ppt\PMA.ppt", True, False, True
ppt.Presentations("pma.ppt").SaveAs rootDirectory & "\docs\PMA_TEST.ppt"
ppt.Presentations("PMA_TEST.ppt").Close
'Close Objects and powerpoint
ppt.Quit
Set ppt = Nothing
-------------------------------------------------------------------------------
I am using a Windows 2003 Server, Microsoft IIS, Coldfusion MX 6.1 and a SQL Server 2000 database. The SQL Server database is on a separate server. I am curious if I have to specify exactly where the server exists? I tried placing “SERVER=myServerName” into that line of code with no luck. I know that the DSN, UID and the PASSWORD are correct because I was able to establish a connection the database by another means. Any help would be greatly appreciated! Thanks.
I am using Coldfusion to call a .vbs file that creates a Powerpoint file using information it pulls from a database. It doesn’t work. Here is the code I am using to execute the .vbs file:
-------------------------------------------------------------------------------
<cfexecute name="C:\WINDOWS\system32\cscript.exe"
arguments="#rootDirectory#\testing.vbs"
outputfile="#docsDirectory#\error.log">
</cfexecute>
-------------------------------------------------------------------------------
I am not sure why the powerpoint file isn’t being generated, but the powerpoint file is generated when I comment out this code (code in the .vbs file):
-------------------------------------------------------------------------------
objConn.Open "DSN=wrd;UID=wrd_user;Password=********"
-------------------------------------------------------------------------------
Here is some more of the code from the .vbs file:
-------------------------------------------------------------------------------
Dim rootDirectory
rootDirectory = "D:\pma"
'Used for recordset object
Dim objConn, objRS
' Define constants from ADOVBS.INC
Const adOpenKeyset = 1
Const adLockOptimistic = 3
Const adCmdText = &H0001
' Create and setup connection object
Set objConn = Server.CreateObject("ADODB.Connection")
objConn.Open "DSN=wrd;UID=wrd_user;Password=********"
Set ppt = CreateObject("Powerpoint.Application")
ppt.Visible = True
ppt.Presentations.Open rootDirectory & "\ppt\PMA.ppt", True, False, True
ppt.Presentations("pma.ppt").SaveAs rootDirectory & "\docs\PMA_TEST.ppt"
ppt.Presentations("PMA_TEST.ppt").Close
'Close Objects and powerpoint
ppt.Quit
Set ppt = Nothing
-------------------------------------------------------------------------------
I am using a Windows 2003 Server, Microsoft IIS, Coldfusion MX 6.1 and a SQL Server 2000 database. The SQL Server database is on a separate server. I am curious if I have to specify exactly where the server exists? I tried placing “SERVER=myServerName” into that line of code with no luck. I know that the DSN, UID and the PASSWORD are correct because I was able to establish a connection the database by another means. Any help would be greatly appreciated! Thanks.