connecting SQL SERVER VIA ODBC PROLEM

connecting SQL SERVER VIA ODBC PROLEM

Postby MANOLO » Mon Jan 29, 2024 5:18 pm

Hello every body long time not connected due de program made by FW works fine, now we are made a change in the server and we have changed mysql by sql server and we have follow problem:

[CODE]
oApp:oCon:ConnectionString:= "Provider=SQLOLEDB;Password=xxxx3;Persist Security Info=True;User ID=XXXX;Initial Catalog=ERP6_base;Data Source=185.80.87.6\SQLEXPRESS2019"
TRY
oApp:oCon:Open()
CATCH oError
MsgInfo("No se pudo lograr la conexión"+OAPP:OCON:CONNECTIONsTRING,oApp:cAplicacion)
ShowError(oError)
RETURN(.F.)
END

// since here de code works ok
// now try to open de recorset and here is the problem
TRY
orsPed := TOleAuto():New("adodb.recordset")
// orsPed:= CreateObject("ADODB.Recordset")
CATCH oError
MsgStop( "No se ha podido crear el RECORDSET de Pedidos!", oApp:cAplicacion)
ShowError(oError)
orsPed := NIL
lret:=.f.
CLOSE_DBF(ODTEMP)
RETURN(lret)
END


orsPed:CursorLocation := adUseClient
orsPed:LockType := adLockOptimistic
orsPed:CursorType := adOpenDynamic


orsped:source:="SELECT * FROM ERP6_base" // ENVIAMOS QUERY DE PRUEBA PARA COMPROBAR CONEXIÓN

orsPed:ActiveConnection( oApp:oCon )

TRY
orsped:open()

CATCH oError
MsgStop( "No se ha podido abrir el RECORDSET de Pedido 386s !", oApp:cAplicacion)
ShowError(oError)
CLOSE_DBF(ODTEMP)
RETURN(.F.)
END
[\CODE]

At this point the program say unknow Open() --- error 1001 ---

I have tried to change connection system but when the program try to open the recordset appears the error

I'm working with FW709 with xharbour - I can not change the version of the FW due the system is too old and sure doen't works with upgrading fw
Thanks for your cooperation
MANOLO
 
Posts: 87
Joined: Sun Oct 09, 2005 8:49 pm
Location: Spain

Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 77 guests