You seem to be using FWH1604. I do not have that version with me. I tried with even an older version FWH1602.
We provide an MSSQL server in the cloud for a demonstration to our users. In the following sample, we connect to this demo server in the cloud and test exporting your DBF.
Our test program:
Code: Select all
#include "fivewin.ch"
REQUEST DBFCDX
function Main()
local oCn, oRs, lOk
MsgRun( "Connecting to MSSQL Cloud Server", FWVERSION, { || ;
oCn := FW_OpenAdoConnection( { "MSSQL", "208.91.198.196", "gnraore3_", "fwhmsdemo", "fwh@2000#" }, .T. ) ;
} )
if oCn == nil
? "Connect Fail"
return nil
else
? "Connected"
endif
// Drop the tables if exists
TRY
oCn:Execute( "DROP TABLE ACCESOIT" )
CATCH
END
//
MsgRun( "Importing DBF to MSSQL", FWVERSION, { || ;
lOK := FW_AdoImportFromDBF( oCn, "ACCESOIT.DBF" ) ;
} )
if lOK
oRs := FW_OpenRecordSet( oCn, "ACCESOIT" )
XBROWSER oRs
else
? "Import Fail"
endif
oCn:Close()
return nil
As you can see, the import worked perfectly.
Please copy the above program to fwh\samples folder without any changes and build it with buildx.bat or buildh.bat. It worked here and it SHOULD work for you too there.
After testing the program without changes, then you substitute your server name and credentials and try again. It has to work.