acabo de probar con tu ejemplo he hice lo mismo...
usas harbour o xharbour?
cree una tabla en sel servidor de dolphin como la definiste en el post anterior
prueba y me comentas
gracias
- Code: Select all Expand view
#include 'fivewin.ch'
#define P_SERVER 'dolphintest.sitasoft.net'
#define P_USER 'test_dolphin'
#define P_PASSW '123456'
#define P_PORT 3306
#define P_FLAGS 0
#define P_DBNAME 'dolphin_man'
STATIC oDb
*--------------
FUNCTION Main()
*--------------
LOCAL cFile, uData, cSql
IF !ConectaDb()
RETU NIL
ENDIF
cFile := cGetFile( '*.*' )
IF !File( cFile )
RETU NIL
ENDIF
uData := D_ReadFile( cFile )
uData := Val2Escape( uData )
uData := ClipValue2Sql( uData )
cSql := "INSERT INTO image SET data = " + uData
MsgInfo( oDb:execute( cSql ) )
RETU NIL
*-------------------
FUNCTION ConectaDb()
*-------------------
oDb := TDolphinSrv():New( P_SERVER, P_USER, P_PASSW, P_PORT, ;
P_FLAGS, P_DBNAME, ;
{| oServer, nError, lInternal | GetError( oServer, nError, lInternal ) } )
RETU !oDb:lError
*-----------------------------------------------------
STATIC FUNCTION GetError( oServer, nError, lInternal )
*-----------------------------------------------------
LOCAL cText := ""
cText += "Descripcio:" + Chr( VK_TAB ) + oServer:ErrorTxt() + CRLF
cText += "Error No: " + Chr( VK_TAB ) + ltrim(Str( nError )) + CRLF
cText += "Internal: " + Chr( VK_TAB ) + If( lInternal, "Yes", "No" ) + CRLF
MsgAlert( cText, 'Error en conexio a MySql' )
RETU NIL