FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour mod harbour connected to MS SQL
Posts: 6983
Joined: Fri Oct 07, 2005 07:07 PM
mod harbour connected to MS SQL
Posted: Mon Apr 12, 2021 08:07 PM
Dear friends,

Mr. Rao shows us how we can connect from mod harbour to MS SQL.

You see mod harbour working against MSSQL. For this to work you need to first install Microsoft OLEDB driver for SQL:
Download Link:
https://docs.microsoft.com/.../download ... iver-for...
Please download 64-bit version and install.
Then the above program will run in mod-harbour.
Note: We do not need to install SQL server on our PC/Server
The name of the installation file you downloaded should be "msoledbsql.msi".
After installing this and restarting the computer, you should find "c:\windows\system32\msoledbsql.dll"
That means the installation is complete.

Best regards,
Otto
Posts: 6755
Joined: Wed Feb 15, 2012 08:25 PM
Re: mod harbour connected to MS SQL
Posted: Mon Apr 12, 2021 09:06 PM

Dear Otto
Link not run

Cristobal Navarro

Hay dos tipos de personas: las que te hacen perder el tiempo y las que te hacen perder la noción del tiempo

El secreto de la felicidad no está en hacer lo que te gusta, sino en que te guste lo que haces
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: mod harbour connected to MS SQL
Posted: Mon Apr 12, 2021 09:23 PM
Function to generate HTML table from a RecordSet.
This code does not depend on FWH and can be used in any non-fwh Harbour application.
Code (fw): Select all Collapse
function RecordSetToHTML( oRs, lHtmlPage )

   local cHTML := ""
   local bm, n

   cHTML := [<table border="1" width="100%">]
   cHTML += "<tr>"
   for n := 0 to oRs:Fields:Count() - 1
      cHTML += ( "<td><b>" + oRs:Fields( n ):Name + "</b></td>" )
   next
   cHTML += "</tr>"

   if oRs:RecordCount() > 0
      bm    := oRs:Bookmark
      oRs:MoveFirst()
      cHTML += "<tr><td>"
      cHTML += oRs:GetString( 2, oRs:RecordCount(), "</td><td>","</td></tr><tr><td>","&nbsp;" )
      cHTML += "</td></tr>"
      oRs:MoveFirst()
      oRs:BookMark   := bm
   endif
   cHTML += "</table>"

   if lHtmlPage == .t.
      cHTML := "<html>" + CRLF + "<body>" + CRLF + cHTML + CRLF + "</body>" + CRLF + "</html>"
   endif

return cHTML
Regards



G. N. Rao.

Hyderabad, India
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: mod harbour connected to MS SQL
Posted: Mon Apr 12, 2021 09:26 PM
cnavarro wrote:Dear Otto
Link not run


https://docs.microsoft.com/en-us/sql/co ... rver-ver15

"https://docs.microsoft.com/en-us/sql/connect/oledb/download-oledb-driver-for-sql-server?view=sql-server-ver15"
Regards



G. N. Rao.

Hyderabad, India
Posts: 6983
Joined: Fri Oct 07, 2005 07:07 PM
Re: mod harbour connected to MS SQL
Posted: Mon Apr 12, 2021 09:38 PM
Dear Mr. Rao,
Thank you.
It is working fine.



Best regards,
Otto
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: mod harbour connected to MS SQL
Posted: Mon Apr 12, 2021 09:46 PM

Wonderful.
Thank you.

Regards



G. N. Rao.

Hyderabad, India

Continue the discussion