FWH and MS SQL

FWH and MS SQL

Postby cdmmaui » Fri May 18, 2012 1:32 am

Hello Everyone,

We are looking to integrate MS SQL to our FWH ADS/DBF application. Does anyone have any examples on connecting/ending connection to MS SQL server and commands (SELECT, INSERT, UPDATE, DELETE)? It would be must appreciated.

Sincerely,
*~*~*~*~*~*~*~*~*~*
Darrell Ortiz
CDM Software Solutions, Inc.
https://www.cdmsoft.com
User avatar
cdmmaui
 
Posts: 689
Joined: Fri Oct 28, 2005 9:53 am
Location: Houston ∙ Chicago ∙ Los Angeles ∙ Miami ∙ London ∙ Hong Kong

Re: FWH and MS SQL

Postby anserkk » Fri May 18, 2012 4:50 am

Connecting to MS SQL Database
Code: Select all  Expand view
// Connecting to MS SQL Database
cConnectSring:="Provider=SQLOLEDB;server=YourIP;database=YourDbName;uid=YourUserName;pwd=YourPassword"
TRY
  oConnection:=CreateObject("ADODB.Connection")
CATCH
  MsgInfo("It seems that your PC does not have MDAC installed OR MDAC is corrupted.")
  Return .F.
END
oConnection:ConnectionString:=cConnectSring

TRY
  oConnection:Open()
CATCH oError
  MsgInfo("Failed to Connect to the Database")
  RETURN .F.
END


Disconnecting from the database
Code: Select all  Expand view
// Disconnecting
if oConnection:State() = adStateOpen
  oConnection:Close()
Endif
oConnection:=NIL


For more eg on ADO and FWH visit the following article in FWH Wiki by Mr.Rick Lipkin
http://fivetechsoft.com/wiki/doku.php?id=ado-related_stuffs&rev=1216796127

Regards
Anser
User avatar
anserkk
 
Posts: 1332
Joined: Fri Jun 13, 2008 11:04 am
Location: Kochi, India

Re: FWH and MS SQL

Postby cdmmaui » Sat May 19, 2012 3:40 am

Thank you for your assistance
*~*~*~*~*~*~*~*~*~*
Darrell Ortiz
CDM Software Solutions, Inc.
https://www.cdmsoft.com
User avatar
cdmmaui
 
Posts: 689
Joined: Fri Oct 28, 2005 9:53 am
Location: Houston ∙ Chicago ∙ Los Angeles ∙ Miami ∙ London ∙ Hong Kong


Return to FiveWin for Harbour/xHarbour

Who is online

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