I am trying to modify an old VB6 application so that it can be used on Windows server 2016. At the moment it works well on Windows XP and Windows 7/10.
But for WIndows Server 2016 I do not get it going. I want to grab temperature data via https://xml.buienradar.nl. In the vb6 project I make a reference to msxml6 which I installed on the Windows 2016 server.
At xmldoc.Load ("https: \ xml.buienradar.nl") I get the error: The download of the specified resource has failed.
Firewall is disabled. Does anyone have any idea? I do not have the idea that it goes wrong with the msxml6.dll. Why does this work with all other operating systems?
Set xmldoc = New DOMDocument60
xmldoc.async = False
If xmldoc.Load("https:\\xml.buienradar.nl") = False Then
LogPrint "Load error: " & xmldoc.parseError.url & " - " &
xmldoc.parseError.reason
Else
-- grab data --
End If
Related
Disclaimer: Yes, I think this questions boils down to understanding some DCOM basics and what VBS CreateObject actually does/needs:
I have a 3rd party application that offers an automation interface via (D?)COM.
The interface is automatically registered when we install the application and it works fine when running simple VBS scripts locally:
This works fine on the same machine:
Dim oAppApi
WScript.Echo "Hello, try to connect ..."
Set oAppApi = CreateObject("theapp.theapp") ' Note that this will either start the application or connect to an already started instance
WScript.Echo oAppApi.APIVersion
oAppApi.DisconnectFromTool
This also works on the same machine:
Dim oAppApi
WScript.Echo "Hello, try to connect ..."
Set oAppApi = CreateObject("theapp.theapp", "localhost")
WScript.Echo oAppApi.APIVersion
oAppApi.DisconnectFromTool
This will fail when run on another PC in the same network:
Dim oAppApi
WScript.Echo "Hello, try to connect ..."
Set oAppApi = CreateObject("theapp.theapp", "machineNameWithAppInstalled") ' FAIL: ActiveX component can't create object
What would be neccessary to make this simple VBScript work from the remote machine?
Would anything need to be installed on the client machine? (COM proxy DLL or somesuch?)
Does the ServerName.TypeNameof CreateObject need to be known on the client side?
Do we have to do some DMCOMCnfg magic on the server?
Additional Details:
Since, from what I know of COM, this might depend on how the stuff is registered, here's my "trace" through the registry for "TheApp.TheApp" on the application PC:
[HKEY_CLASSES_ROOT\TheApp.TheApp]
#="com.company.toolAPI.theapp.theapp"
[HKEY_CLASSES_ROOT\TheApp.TheApp\CLSID]
#="{0CBEA087-0CC7-4D15-A659-8B3AC68B82E1}"
[HKEY_CLASSES_ROOT\TheApp.TheApp\CurVer]
#="TheApp.TheApp.7.2"
...
[HKEY_CLASSES_ROOT\TheApp.TheApp.7.2]
#="TheApp.TheApp"
[HKEY_CLASSES_ROOT\TheApp.TheApp.7.2\CLSID]
#="{0CBEA087-0CC7-4D15-A659-8B3AC68B82E1}"
...
[HKEY_CLASSES_ROOT\AppID\{0CBEA087-0CC7-4D15-A659-8B3AC68B82E1}]
#="THEAPP72 Server"
"DllSurrogate"=""
"RunAs"="Interactive User"
...
[HKEY_CLASSES_ROOT\Wow6432Node\CLSID\{0CBEA087-0CC7-4D15-A659-8B3AC68B82E1}]
#="com.company.toolAPI.theapp.theapp"
"AppID"="{0CBEA087-0CC7-4D15-A659-8B3AC68B82E1}"
[HKEY_CLASSES_ROOT\Wow6432Node\CLSID\{0CBEA087-0CC7-4D15-A659-8B3AC68B82E1}\Implemented Categories]
[HKEY_CLASSES_ROOT\Wow6432Node\CLSID\{0CBEA087-0CC7-4D15-A659-8B3AC68B82E1}\Implemented Categories\{62C8FE65-4EBB-45e7-B440-6E39B2CDBF29}]
[HKEY_CLASSES_ROOT\Wow6432Node\CLSID\{0CBEA087-0CC7-4D15-A659-8B3AC68B82E1}\InprocServer32]
#="mscoree.dll"
"ThreadingModel"="Both"
"Class"="com.company.toolAPI.theapp.theapp"
"Assembly"="TheAppCOM, Version=11.0.0.0, Culture=neutral, PublicKeyToken=c9b6e760b808c9f9"
"RuntimeVersion"="v2.0.50727"
"CodeBase"="file:///C:/Company/THEAPP7.2/interface/TheAppCOM.DLL"
[HKEY_CLASSES_ROOT\Wow6432Node\CLSID\{0CBEA087-0CC7-4D15-A659-8B3AC68B82E1}\InprocServer32\11.0.0.0]
"Class"="com.company.toolAPI.theapp.theapp"
"Assembly"="TheAppCOM, Version=11.0.0.0, Culture=neutral, PublicKeyToken=c9b6e760b808c9f9"
"RuntimeVersion"="v2.0.50727"
"CodeBase"="file:///C:/Company/THEAPP7.2/interface/TheAppCOM.DLL"
[HKEY_CLASSES_ROOT\Wow6432Node\CLSID\{0CBEA087-0CC7-4D15-A659-8B3AC68B82E1}\ProgId]
#="TheApp.TheApp"
I used RDS.DataSpace to access a 'middle-tier' dcom server.
Example: http://www.oblique.ch/ms/rds25.html#_Toc483670219
i have created exe file connector (called it directory server.exe) from server (original exe called abi.exe) to client pc, the connector i created was using set default and set path to, i copy the directory server (connector) and abi.exe to the client pc. input the server address and client address.
the abi.exe was working good. until i want to print report on my client pc (set up margin). so i copy again the report.frx (called faktur1.frx) to client pc along with the abi.exe. i opened the faktur1.frx, it show some error "file in use"
some help will be great. thanks and sorry for the bad english.
IF FILE('clientuser.mem')
RESTORE FROM clientuser ADDITIVE
mz_dir = RTRIM(zdirserver)
mx_dir = RTRIM(zdirclient)
ELSE
mz_dir = ''
mx_dir = ''
ENDIF
thisform.defa.value = mz_dir
thisform.path.value = mx_dir
i used that syntax and ended report error "file in use" when i copied the report from server to client pc, sorry for bad english
I've built a complex Shiny interface that pulls from an internally networked ODBC table and allows a user to interact with the data through their browser. The company is on Windows 7 Enterprise and IT only supports IE 9. Some users have chrome installed in their user folders, some have firefox, some use IE 9. I followed a tutorial from R-Bloggers (here: http://www.r-bloggers.com/deploying-desktop-apps-with-r/) and it runs on my machine using a portable Chrome browser downloaded from PortableApps.com. Great. Unfortunately the interface has not started on ANYONE else's machine that has their own local Chrome browser installed.
Following the tutorial, I use the following vb script:
Rexe = "R-Portable\App\R-Portable\bin\Rscript.exe"
Ropts = "--no-save --no-environ --no-init-file --no-restore --no-Rconsole"
RScriptFile = "runShinyApp.R"
Outfile = "ShinyApp.log"
strCommand = Rexe & " " & Ropts & " " & RScriptFile & " 1> " & Outfile & " 2>&1"
intWindowStyle = 0 ' Hide the window and activate another window.'
bWaitOnReturn = False ' continue running script after launching R '
CreateObject("Wscript.Shell").Run strCommand, intWindowStyle, bWaitOnReturn
This script calls the following code in my R file:
message('library paths:\n', paste('... ', .libPaths(), sep='', collapse='\n'))
chrome.portable = file.path(getwd(),'GoogleChromePortable/App/Chrome-bin/chrome.exe')
launch.browser = function(appUrl, browser.path=chrome.portable) {
message('Browser path: ', browser.path)
shell(sprintf('"%s" --app=%s', browser.path, appUrl))
}
shiny::runApp('shiny', launch.browser=launch.browser)
It works on my computer just fine... I DO have chrome installed locally, but I'm calling the Portable Chrome executable. It worries me that the two are sharing prefs or something, e.g. I notice that a hash from the Preferences file in my installed version, specifically:
"chrome_url_overrides": {
"bookmarks": [ "chrome-extension://eemcgdkfndhakfknompkggombfjjjeno/main.html" ]
},
...matches the same json entry from the Portable Chrome installation:
"chrome_url_overrides": {
"bookmarks": [ "chrome-extension://eemcgdkfndhakfknompkggombfjjjeno/main.html" ]
}
Why do these long random strings match? Am I barking up the wrong tree for wondering about this? I don't know why these strings match if they are two separate installations of Chrome executables, one of which is supposed to run completely independently from anything on the machine.
Here's a set of errors from one machine:
.../Desktop/TestApp3/GoogleChromePortable/App/Chrome-bin/chrome.exe[9100:9408:0716/141934:ERROR:gpu_info_collector_win.cc(103)] Can't retrieve a valid WinSAT assessment.
[9100:9408:0716/141934:ERROR:component_loader.cc(138)] Failed to parse extension manifest.
[9100:1716:0716/141946:ERROR:get_updates_processor.cc(214)] PostClientToServerMessage() failed during GetUpdates
Here's a set of errors from a second machine:
.../Documents/TestApp3/GoogleChromePortable/App/Chrome-bin/chrome.exe
[5220:3384:0714/142128:ERROR:component_loader.cc(138)] Failed to parse extension manifest.
[5220:7600:0714/142130:ERROR:external_registry_loader_win.cc(136)] File C:\Program Files\Coupons.com CouponBar\chrome\Coupons.com.crx for key
Software\Google\Chrome\Extensions\cnpkmcjgpcihgfnkcjapiaabbbplkcmf does not exist or is not readable.
[5220:2120:0714/142140:ERROR:get_updates_processor.cc(214)] PostClientToServerMessage() failed during GetUpdates
[5220:3384:0714/142413:ERROR:CONSOLE(122)] "Could not find value for secondaryUser", source: chrome://resources/js/load_time_data.js (122)
[5220:3384:0714/142413:ERROR:CONSOLE(122)] "[undefined] (secondaryUser) is not a boolean", source: chrome://resources/js/load_time_data.js (122)
[5220:3384:0714/142425:ERROR:CONSOLE(122)] "Could not find value for secondaryUser", source: chrome://resources/js/load_time_data.js (122)
[5220:3384:0714/142425:ERROR:CONSOLE(122)] "[undefined] (secondaryUser) is not a boolean", source: chrome://resources/js/load_time_data.js (122)
[5220:3384:0714/142442:ERROR:navigation_entry_screenshot_manager.cc(167)] Invalid entry with unique id: 12
It seems like Chrome is doing different things on different computers and is not actually acting as a standalone browser... but likely interacting with the browser installed on their respective computers via the registry or some other "under the hood, active" communication. Maybe, since I installed the portable executable on my machine, a bunch of my local extensions or preferences were automatically updated to the portable's preferences, etc. and subsequently this is causing a conflict on every other machine??
Can I shutdown Chrome's extensions or extra functions like the calls to the updater? Is there a better standalone portable browser that functions well with Shiny for this type of "deployment" purpose? Can I fix this or is this a lost cause?? This should be obvious but I'll say it anyway: it is definitely not economically efficient to ask the non-technical types to install R, then RStudio, then confirm their working directory structure, then call the runApp() command via the Script window...
I started with those same articles, but developed the RInno package to solve this exact problem, i.e. when you want to share your desktop Shiny app with non-technical users who can't be expected to mess around with all those details.
To get started:
install.packages("RInno")
require(RInno)
RInno::install_inno()
Then you just need to call two functions to create an installation framework:
create_app(app_name = "myapp", app_dir = "path/to/myapp")
compile_iss()
This will create an installation wizard that runs like any other program, but installs your shiny app on a Windows desktop computer. If you would like to include R for your co-workers who don't have it installed, add include_R = TRUE to create_app:
create_app(app_name = "myapp", app_dir = "path/to/myapp", include_R = TRUE)
It defaults to include shiny, magrittr and jsonlite, so if you are using other packages like ggplot2 or plotly, just add them to the pkgs argument. You can also include GitHub packages to the remotes argument:
create_app(
app_name = "myapp",
app_dir = "path/to/myapp"
pkgs = c("shiny", "jsonlite", "magrittr", "plotly", "ggplot2"),
remotes = c("talgalili/installr", "daattali/shinyjs"))
If you are interested in other features, check out FI Labs - RInno
I'm making changes to a website written in classic asp.
My system is a Windows 7 64-bit.
I've been able to get the website to run, after setting it up as a classic asp running on IIS6.
When it attempts to execute the following code, I get the permission denied error:
from1 = "Kevin#company.com"
to1 = "staff1#company.com"
to2 = "staff2#company.net"
to3 = "staff3#client.com"
strTo = to1
If Len(strTo) > 0 Then
If Len(to2) > 0 Then
strTo = strTo & ";" & to2
End If
Else
strTo = to2
End If
If Len(strTo) > 0 Then
If Len(to3) > 0 Then
strTo = strTo & ";" & to3
End If
Else
strTo = to3
End If
body = reqApprName & "<br />" & reqApprPhone & "<br />" & reqApprEmail & "<br />Loan Number: "_
& loannum & "<br /><br />Please do not reply back to this email. The Vendor has provided the following "_
& "comment associated with this order.<br /><br />" & reqUndueInfluenceComment
Set ObjMail = CreateObject("CDONTS.Newmail")
ObjMail.From = from1
ObjMail.To = strTo
ObjMail.Subject = "Appraisal Order "&OrderNum&" by Vendor"
ObjMail.BodyFormat = 0
ObjMail.MailFormat = 0
ObjMail.Body = body
ObjMail.Send
Set ObjMail = Nothing
I'm puzzled, since I've never had a problem with CDONTS before. Then again, I've never tried using it on a Windows 7 64 bit machine, using 32 bit classic asp.
Does anyone have any ideas?
Thanks, all.
PS: I get the error on the create object for CDONTS.NewMail
When you try to send a message, you may receive the following error message:
Microsoft VBScript runtime error '800a0046' Permission denied
This problem occurs when an application is run out-of-process in IIS.
When this problem occurs, the user context of the process changes from the IUSR_MachineName account that does have access to the IIS metabase to the IWAM_MachineName account that does not have access to the IIS metabase.
Typically, this error has two causes.
Cause 1
The user under whom the .asp page is running or the script is running does not have permissions to the Pickup directory.
Typically, the Pickup directory is found in the following locations:
For computers that are running IIS only:
C:\Inetpub\Mailroot\Pickup
For computers that are running Microsoft Exchange 5.5:
Exchsrvr\Mailroot\Pickup
For computers that are running Exchange 2000:
\Program files\Exchsrvr\Mailroot\Vsi #\Pickup
Solution
The user under whom the .asp page is running or the script is running must have Modify (Change) permission to the Pickup directory so that the NewMail object can create the .eml file.
Cause 2
The page is running in its own memory space and is being denied access to the IIS metabase. To verify this, follow these steps:
Click Start, click Run, type Inetmgr, and then click OK.
Right-click either the root directory or the virtual directory that contains your page, and then click Properties.
If you right-clicked the root directory in step 2, click the Home Directory tab.
If you right-clicked the virtual directory in step 2, click the Virtual Directory tab.
On a computer that is running Windows NT, determine whether the Run in separate memory space check box is checked.
If the Run in separate memory space check box is checked, click to clear the check box. Alternatively, on the Properties menu of the SMTP service, click the Operators tab, and then add the IWAM_MachineName account.
On a computer that is running Windows 2000, determine whether the Application Protection setting is set to High (Isolated). If the Application Protection setting is set to High (Isolated), set the Application Protection setting to Medium (Pooled). Alternatively, on the Properties menu of the SMTP service, click the Security tab, and then add the IWAM_MachineName account to the Operators account.
Support.Microsoft.com
I have an old VB6 app that I need to get working on a Windows 7 x64 workstation (at least for a little while).
It's failing on me when I try to connect to my test database (Oracle 10gR2). I get an "ORA-06413: Connection not open error."
Now, I recognise that the "Microsoft ODBC for Oracle" driver is deprecated because it doesn't play nice with newer versions of Oracle. It seems to work fine with the same database on an XP box I have access to.
I also see that the driver seems to still exist on Windows 7 x64 (at least when I look at the 32 bit version of the ODBC data Source Administrator tool: c:\Windows\SysWOW64\odbcad32.exe in the Drivers tab.
On the XP box, it doesn't seem to matter what I see up for an ODBC connection, it seems to bypass any sort of predefined connection.
Attached is the relevant code. Is there any way to make this work in Win7x64?
Global g_sConnectionString As String
Global g_oConn As ADODB.Connection
Public Sub CreateOracleConn()
Err.Clear
On Error Goto ConnectionError
g_sConnectionString = "Driver={Microsoft ODBC for Oracle}; " _
& "SERVER=" & "MyHost" _
& ";UID=" & "MyUserID" _
& ";PWD=" & "MyPassword & ";"
Set g_oConn = New ADODB.Connection
g_oConn.Open g_sConnectionString '<-- fails here
Exit Sub
ConnectionError:
If Err.Number <> 0 Then
'Clean up from the error
End If
End Sub
The problem entirely relates to where Visual Basic 6 is installed. By default it is installed in C:\Program Files (x86)\Microsoft Visual Studio\VB98\VB6.EXE
If you change its location to something like:
C:\ProgramFilesX86\Microsoft Visual Studio\VB98\VB6.EXE
It runs properly.