TsBrowse with ADORDD Recordset

TsBrowse with ADORDD Recordset

Postby sanilpmc » Wed Jun 18, 2008 6:27 am

I am first time in this forum, I am using Harbour.I am having some doubt about TSBrowse regarding the display of MS SQL 2005 record set on TSBrowse. TSBrowse is not displaying any records. I was using TSBrowse ver 7. When I searched FiveWin forum I found some solution in FIVEWIN forum about this query. I tried it but it not solved the issue.
In your solutions <Browser Name>:SetAdo(<Record set Name>)is used for showing recordset data. But in TSBrowser7 doesn’t have SetAdo Method. So I download TSBrower ver 8 (Link provide in FiveWin Forum) and tried to make lib file. But I can’t make TSBrowse Lib file and when I read the TsBrowse ver 8 Source code, SetAdo() function in source prg file, seams to be commented and 2 sub method AdoSkip() and AdoGenFldBlk() used by SetAdo method is missing.
I am struck right now with TSBrowse ver 8.

Is it possible to get any help from the experts of this forum on displaying recordset data of Microsoft Sql 2005 on TsBrowse. 7 or TsBrowse ver 8

I am herewith pasting the my code for connecting to SQL Server

Connection String
Code: Select all  Expand view  RUN

CnAdo:=CreateObject("ADODB.Connection")
CnAdo:Open("Provider=MSDASQL;driver=SQL
Server;Server=SANIL\SQLEXPRESS;Uid=sa;Pwd=sa;Database=dbpdms;"
)
RsAdo:=CreateObject("ADODB.Recordset")

TSBrowse Definition
DEFINE WINDOW FRMSPARE;
AT GetDesktopRealTop()+40,GetDesktopRealLeft();
WIDTH GETDESKTOPREALWIDTH();
HEIGHT GETDESKTOPREALHEIGHT()-60;
NOMAXIMIZE NOSIZE;
TITLE "Spare Parts";
ICON "PDMS";
ON INTERACTIVECLOSE Frm_Close("Spare Parts","N");
CHILD
DEFINE TBROWSE oTBrw_Spare AT 320,5;
OF FRMSPARE WIDTH (GETDESKTOPREALWIDTH()-25) HEIGHT 320 CELLED

Sql_Query :="sp_PartType '"+ SqlSelect +"','" + COMPANYCD + "','" +
BRANCHCD + "','" + CENTERTYPE + "'"
If RsAdo:State ==1
RsAdo:Close()
Endif

RsAdo:Open(Sql_Query,CnAdo,2,3)

SetDb(oTBrw_Spare)

ADD COLUMN TO oTBrw_Spare ;
HEADER "Part Name" ;
DATA {||RsAdo:Fields["Part_Type_Desc"]:Value};
3DLOOK FALSE SIZE 700

END TBROWSE
oTBrw_Spare:Refresh()

END WINDOW


*---------------------------------------------------------------------------
Procedure SetDb(oTBrw_Spare)
*---------------------------------------------------------------------------

oTBrw_Spare:nRowPos := 1
oTBrw_Spare:nColPos := 1
oTBrw_Spare:nCell := 1
oTBrw_Spare:lHitTop := .F.
oTBrw_Spare:lHitBottom := .F.
oTBrw_Spare:HiliteCell( 1 )


oTBrw_Spare:bLogicLen := {|| RsAdo:RecordCount() }
oTBrw_Spare:bGoTop := {|| RsAdo:GoTop() }
oTBrw_Spare:bGoBottom := {|| RsAdo:GoBottom() }
oTBrw_Spare:bSkip := {|nSkip|fSkipper(nSkip)}
oTBrw_Spare:nLen := Eval(oTBrw_Spare:bLogicLen)

return


*--------------------------
Function fSkipper(nRecs)
*--------------------------
local nSkipped := 0

IF !RsAdo:Eof()

Do Case
Case nRecs == 0

Case nRecs > 0
WHILE nSkipped < nRecs
IF !RsAdo:Eof()
RsAdo:Skip(1)
IF RsAdo:Eof()
RsAdo:Gobottom()
EXIT
ENDIF
nSkipped++
ENDIF
ENDDO
Case nRecs < 0

DO WHILE nSkipped > nRecs
IF .NOT. RsAdo:Bof()
RsAdo:Skip(-1)
IF RsAdo:Bof()
RsAdo:Gotop()
EXIT
ENDIF
nSkipped--
ENDIF
ENDDO
End Case

ENDIF

RETURN nSkipped
 
sanilpmc
 
Posts: 36
Joined: Tue Jun 17, 2008 7:09 am

Re: TsBrowse with ADORDD Recordset

Postby mmercado » Wed Jun 18, 2008 5:31 pm

sanilpmc wrote:I am first time in this forum, I am using MiniGui with Harbour.I am having some doubt about TSBrowse regarding the display of MS SQL 2005 record set on TSBrowse. TSBrowse is not displaying any records. I was using TSBrowse ver 7. When I searched FiveWin forum I found some solution in FIVEWIN forum about this query. I tried it but it not solved the issue.

Hello, wellcome to this forum:

Please give me an email to send you some new TSBrowse stuff.

Regards.

Manuel Mercado
User avatar
mmercado
 
Posts: 782
Joined: Wed Dec 19, 2007 7:50 am
Location: Salamanca, Gto., México

Re: TsBrowse with ADORDD Recordset

Postby sanilpmc » Thu Jun 19, 2008 5:19 am

mmercado wrote:Hello, wellcome to this forum:

Please give me an email to send you some new TSBrowse stuff.

Regards.

Manuel Mercado


Hai Manuel Mercado,
My email ids: sanilpmc@gmail.com / sanilpmc@yahoo.com
Right now I am using TSBrowse Ver 7 which is bundled along with the Harbour Extended Ver 1.5-52 .
I require an updated version which supports to display Record set of MS Sql Server which can be used with Harbour. The language is English. Is it possible to get a copy of the lib also along with the source. I am not an expert in compiling the source to lib, and that’s why I am asking for a lib for Harbour Extended Ver 1.5-52

Regards
Sanil
sanilpmc
 
Posts: 36
Joined: Tue Jun 17, 2008 7:09 am

Re: TsBrowse with ADORDD Recordset

Postby mmercado » Thu Jun 19, 2008 9:20 am

sanilpmc wrote:
mmercado wrote: I require an updated version which supports to display Record set of MS Sql Server which can be used with Harbour. The language is English. Is it possible to get a copy of the lib also along with the source. I am not an expert in compiling the source to lib, and that’s why I am asking for a lib for Harbour Extended Ver 1.5-52

Hi Sanil, I'm sorry but there is a confusion, my support is for TSBrowse for FiveWin, in fact I didn't know anything about the existence of a mg TSBrowse adaptation.

Certainly I'm working by now in recodset browsing but it is just for the the FiveWin original version.

Best regards.

Manuel Mercado
User avatar
mmercado
 
Posts: 782
Joined: Wed Dec 19, 2007 7:50 am
Location: Salamanca, Gto., México


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot] and 72 guests