[R] Haver connectivity progress and issues

amit jain buddyhi at indiatimes.com
Wed Nov 24 17:10:24 CET 2010


Dear All,

I have been trying to connect to haver to download data and have made some good progress.
I am stuck at a point and would appreciate your help.

Haver provides a dll called DLXAPI32 using which i can connect to excel/vb/c etc.

Now i tried calling it from R and used following code:
 
options(warn.FPU = TRUE)
dyn.load("DLL/dlxapi32.dll")

Warning message:
In inDL(x, as.logical(local), as.logical(now), ...) :
  DLL attempted to change FPU control word from 8001f to 9001f
 --- gives a warning that dll attempted to change hex code
Since its just a warning, I ignored it, since my code options(warn.FPU = TRUE) will let me know if the hex code is actually changed



is.loaded("DLXOpenDatabase")  
[1] TRUE

# is.loaded is a function to check if "DLXOpenDatabase" symbol is loaded. As the output shows this symbol gets loaded and is ready to be used

> is.loaded("DLXOpenDatabase")
[1] TRUE
> is.loaded("DLXOpenDatabase",type= "C")
[1] TRUE
> is.loaded("DLXOpenDatabase",type= "Call")
[1] TRUE
> is.loaded("DLXOpenDatabase",type= "External")
[1] TRUE
> is.loaded("DLXOpenDatabase",type= "Fortran")
[1] TRUE


Above code lines show that the function DLXOpenDatabase is available to be used.

Now, when i use the following call the R crashes

.C("DLXOpenDatabase","W:/DLX/USECON")

"W:/DLX/USECON" is parameter for the function DLXOpenDatabase which is successfully used in VB call
Normally this call should give me an output "0" which shows the connection is successfully established, but the R crashes.


My question is "Is this because Haver DLL malfunctioned" or is this because i am doing something wrong.

http://127.0.0.1:29087/library/base/html/dynload.html is the link to help i used

Thanks in advance for your help.

Amit



More information about the R-help mailing list