Page 1 of 1

MSSQL EXPRESS NativeError : 3621

Posted: Wed Mar 17, 2021 4:31 pm
by mauri.menabue
Hi all

I tried to import a .dbf file to a SQLEXPRESS server version 2019 but this error happens: 'NATIVEERROR : 3621',
it seems to me that the problem stems from the conversion of the fields of type : 'DATE' to 'DATETIME' in fact changing
the code of line 1010 of the PRG ADOFUNCS. PRG in this way

case 'D'
if snDbms == DB_MSSQL
1010 cSql += " DateTime" // Date dataype not compat with older servers <----------Original---------------------
// Even with latest providers there are some issues in usage
else
cSql += " DATE"
endif
exit

case 'D'
if snDbms == DB_MSSQL
1010 cSql += " DATE" // Date dataype not compat with older servers <--------------Changed-----------------
// Even with latest providers there are some issues in usage
else
cSql += " DATE"
endif
exit

the import of the dbf file takes place regularly, I report the source that I used to carry out the import.

Code: Select all | Expand


#include "fivewin.ch"

REQUEST DBFCDX

function Main()

   local oCn, oRs, lOk

   MsgRun( "Connecting to MSSQL Cloud Server", FWVERSION, { || ;
      oCn := FW_OpenAdoConnection( { "MSSQL", "127.0.0.1", "tempdb", "Sa", "Mena" }, .T. ) ;
      } )

   if oCn == nil
      ? "Connect Fail"
      return nil
   else
      ? "Connected"
   endif

   // Drop the tables if exists
   TRY
      oCn:Execute( "DROP TABLE SCADENZARIO" )
   CATCH
   END
   //
   MsgRun( "Importing DBF to MSSQL", FWVERSION, { || ;
      lOK := FW_AdoImportFromDBF( oCn, "SCADENZARIO.DBF" ) ;
      } )
   if lOK
      oRs   := FW_OpenRecordSet( oCn, "SCADENZARIO" )
      XBROWSER oRs
   else
      ? "Import Fail"
   endif

   oCn:Close()

return nil
 


How can you solve the problem

Thanks
Maurizio Menabue

Re: MSSQL EXPRESS NativeError : 3621

Posted: Thu Mar 18, 2021 4:29 am
by nageswaragunupudi
We will check with SQLEXPRESS 2019 or later once again.
But we are pretty sure that if we adopt your modification, 99% of servers will fail.