mod harbour connected to MS SQL

Post Reply
User avatar
Otto
Posts: 6414
Joined: Fri Oct 07, 2005 7:07 pm
Has thanked: 31 times
Been thanked: 2 times
Contact:

mod harbour connected to MS SQL

Post by Otto »

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
Image
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
https://www.facebook.com/groups/modharbour.club
********************************************************************
User avatar
cnavarro
Posts: 6558
Joined: Wed Feb 15, 2012 8:25 pm
Location: España
Been thanked: 3 times

Re: mod harbour connected to MS SQL

Post by cnavarro »

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
User avatar
nageswaragunupudi
Posts: 10729
Joined: Sun Nov 19, 2006 5:22 am
Location: India
Been thanked: 10 times
Contact:

Re: mod harbour connected to MS SQL

Post by nageswaragunupudi »

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: Select all | Expand

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
User avatar
nageswaragunupudi
Posts: 10729
Joined: Sun Nov 19, 2006 5:22 am
Location: India
Been thanked: 10 times
Contact:

Re: mod harbour connected to MS SQL

Post by nageswaragunupudi »

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
User avatar
Otto
Posts: 6414
Joined: Fri Oct 07, 2005 7:07 pm
Has thanked: 31 times
Been thanked: 2 times
Contact:

Re: mod harbour connected to MS SQL

Post by Otto »

Dear Mr. Rao,
Thank you.
It is working fine.

Image

Best regards,
Otto
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
https://www.facebook.com/groups/modharbour.club
********************************************************************
User avatar
nageswaragunupudi
Posts: 10729
Joined: Sun Nov 19, 2006 5:22 am
Location: India
Been thanked: 10 times
Contact:

Re: mod harbour connected to MS SQL

Post by nageswaragunupudi »

Wonderful.
Thank you.
Regards

G. N. Rao.
Hyderabad, India
Post Reply