marcioe Posted December 18, 2018 Report Share Posted December 18, 2018 Pessoal eu uso a SLQLLIB, e diga-se de passagem é bem boa, porem está descontinuada. Pois bem Estou tentando passa para o acesso "nativo do Fivewin" ao mariadb, mas sem exito dá o Seguinte erro Application =========== Path and name: C:\PROJETOS\NATIVO\NATIVO.EXE (32 bits) Size: 3,913,216 bytes Compiler version: xHarbour 1.2.3 Intl. (SimpLex) (Build 20181011) FiveWin version: FWH 18.11 C compiler version: Borland/Embarcadero C++ 7.3 (32-bit) Windows version: 6.2, Build 9200 Time from start: 0 hours 0 mins 0 secs Error occurred at: 12/18/18, 18:07:00 Error description: Error BASE/3012 Argument error: STRTOHEX Args: [ 1] = U [ 2] = U Stack Calls =========== Called from: => STRTOHEX( 0 ) Called from: .\source\internal\FWMARIA.PRG => FWMARIACONNECTION:NEW( 5259 ) Called from: => HB_EXECFROMARRAY( 0 ) Called from: .\source\internal\FWMARIA.PRG => MARIA_CONNECT( 141 ) Called from: C:\PROJETOS\NATIVO\PRG_OBJ\SISTEMA.PRG => CONNECTTO( 65 ) Called from: C:\PROJETOS\NATIVO\PRG_OBJ\SISTEMA.PRG => MAIN( 23 ) System ====== #Include "FiveWin.ch" #define CRLF Chr( 13 ) + Chr( 10 ) #define HKEY_LOCAL_MACHINE 2147483650 // 0x80000002 //ANNOUNCE RDDSYS REQUEST OrdKeyNo, OrdKeyCount, OrdKeyGoto REQUEST DBFCDX, DBFFPT REQUEST HB_LANG_PT REQUEST HB_CODEPAGE_PT850 //--------------------------------------------------------------------------// Function Main() LOCAL oQry, cCmdSql, cText, wRowId:=0 PRIVATE cServer := "localhost" PRIVATE cUser := "root" PRIVATE cPassword := 123 PRIVATE nPort := 3306 PRIVATE cDBName := "imobiliaria" PRIVATE nFlags := 0 PRIVATE oServer := NIL IF ( oServer := ConnectTo() ) == NIL msgAlert("Erro de conexão") return nil else MsgInfo('Acessou') ENDIF oQry = oServer:Query( "SELECT * FROM nombres" ) oQry:GoBottom() cCmdSql:= "INSERT INTO nombres ( " cCmdSql += "nombre" + "," cCmdSql += "apellido1" + "," cCmdSql += "apellido2" + "," cCmdSql += "direccion" + "," cCmdSql += "edad" + "," cCmdSql += "poblacion" + "," cCmdSql += "provincia )" cCmdSql += "VALUES(" cCmdSql += "'"+cNombre+"'" +"," cCmdSql += "'"+cApellido1+"'" +"," cCmdSql += "'"+cApellido2+"'" +"," cCmdSql += "'"+cDireccion+"'" +"," cCmdSql += ""+str(cEdad)+"" +"," cCmdSql += "'"+cPoblacion+"'" +"," cCmdSql += "'"+cProvincia+"' )" oServer:Execute( cCmdSql ) IF oServer:nError = 0 MSGRUN(OemToAnsi("Registros inclusos com Sucesso..."),OemToAnsi("ATEN€ÇO...")) ELSE MSGRUN(OemToAnsi("Nao foi possivel Incluir os Registros..."),OemToAnsi("ATEN€ÇO...")) oServer:ShowError() ENDIF oServer:End() msginfo("Fim da Conexao...") Return Nil //---------------------------------------------------------- FUNCTION ConnectTo() LOCAL oErr LOCAL cText := "" FWCONNECT oServer HOST cServer USER cUser PASSWORD cPassword DATABASE cDBName if oServer == nil MsgAlert( "Failed to connect" ) return nil ELSE cText += "Connection OK" + CRLF cText += "Host: " + cServer +CRLF cText += "Database: " +cDBName + CRLF cText += "" + CRLF cText += "" msginfo( cText ,"Dados da conexão ") ENDIF RETURN(oServer) //--------------------------------------------------------------------// // FIM DO PROGRAMA Quote Link to comment Share on other sites More sharing options...
kapiaba Posted December 19, 2018 Report Share Posted December 19, 2018 Incluiu, C:\FWH1811\LIB\libmysql32.lib Quote Link to comment Share on other sites More sharing options...
alex2002 Posted December 19, 2018 Report Share Posted December 19, 2018 Márcio, Por acaso, sua variável cPassword não está errado não? Vc está mandando como númerico, uma vez que senha é char Um abraço, Alexandre Pereira Quote Link to comment Share on other sites More sharing options...
marcioe Posted December 19, 2018 Author Report Share Posted December 19, 2018 Blz, um amigo conectou aqui e resolvemos. era isso mesmo.... microfly 1 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.