Clipper/FiveWin - HELP con SQL

 
Vista:

HELP con SQL

Publicado por Luis Ponce (119 intervenciones) el 20/08/2007 23:27:49
Hola amigos del foro, tengo un incoveniente al acceder a una base de datos en SQL, utilizo el FW 24, linkeo con BLINKER 7.0, y estas lineas las copie del foro, pero no funciona, alguien podria ayudarme ??

// FiveWin ODBC support test with SQL SERVER
// Direct use with no RDD
// Very important: You must set stacksize to 17500 at the LNK file!

#include "FiveWin.ch"
#include "sql.ch"

//----------------------------------------------------------------//

function Main()

Local oOdbc, oDbf, oQuery
local aData := {}
local aTablas := {}
Local nFor

SET 3D LOOK ON

oOdbc := TOdbc():New( "INTELSOFT","sa","" )

If !oOdbc:lSuccess
oOdbc:ShowErrorList("ODBC session not successfully initialized, aborting...")
oOdbc:End()
return nil
* ELSE
* MSGINFO("SESION INICIADA")
* aTablas:=oOdbc:GetTables()
* MsgList(aTablas)
Endif

// Abrimos la tabla directamente

oQuery:=TDbOdbc():New(oODbc)
oQuery:Execute("select * from tperdat")

MsgInfo( "here" )

if oOdbc:IsError()
oOdbc:ShowErrorList()
oOdbc:aErrors := {}
oDbf:End()
return nil
endif

oDbf:Gotop()

Do While !oDbf:Eof()
Aadd(aData, oDbf:FieldGet(1))
oDbf:Skip()
Enddo

MsgArray(aData, "Fields values " + oDbf:FieldName(1))

oDbf:End()
oOdbc:End()

return nil

FUNCTION MsgArray( aArray, cMsg )

LOCAL cText := ""

DEFAULT cMsg := ""

Aeval(aArray, {|v| cText += cValToChar(v)+CRLF})

MsgInfo(cText, cMsg)

RETURN NIL

De ante mano les agradezco

Att.
Luis Ponce
Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder

RE:HELP con SQL

Publicado por El Duro (121 intervenciones) el 21/08/2007 00:24:26
Luis:

Que debemos entender por "no funciona", no hace la conexión ?, se conecta pero no te muestra nada ?, ayudanos a ayudarte !

El Duro
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar

RE:HELP con SQL

Publicado por Luis Ponce (119 intervenciones) el 22/08/2007 15:11:23
Gracias por la respuesta, el error es el siguiente :

ERROR BASE/1077 Argumente Error .NOT.

TDBODBC:UPDATE(0)
TDBODBC:EXECUTE(0)
MAIN(36) // DONDE ESTA LA CONSULTA "SELECT * FROM TPERDAT"

Agradecere mucho vuestra ayuda
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar

RE:HELP con SQL

Publicado por Gabriel Pascual (913 intervenciones) el 21/08/2007 01:13:51
El soporte ODBC en FiveWin de 16 bits, es deficiente, requieres varias clases adicionales, lo mejor es utilizar FiveWin Harbour con el soporte ADO o el ADORDD gratuito para xHarbour.
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar