MS-SQL y Fivewin

MS-SQL y Fivewin

Postby Compuin » Wed Mar 16, 2016 2:46 pm

Saludos foro,

Actualmente manejo una Base de Datos MS SQL Server y necesitamos desarrollar una aplicacion que conecte con la misma. Obviamente TDolphin no es opcion y cambiar a MySQL tampoco, asi que toca ADO o algun otra herramienta de fw para conectar.

Podria alguien aportarme como maneja este tipo de conexion entre una aplicacion y la BBDD

Gracias de antemano
FWH 20.12
Hbmk2 32/64 Bits (Build 19.29.30133)
Microsoft Visual C 32 Bits
MySql 8.0.24 32/64 Bits
VS Code
Compuin
 
Posts: 1214
Joined: Tue Dec 28, 2010 1:29 pm
Location: Quebec, Canada

Re: MS-SQL y Fivewin

Postby horacio » Wed Mar 16, 2016 4:25 pm

Si te conectas con ADO no hay mayores problemas. Busca la cadena de conexión y sales andando.

Saludos
horacio
 
Posts: 1363
Joined: Wed Jun 21, 2006 12:39 am
Location: Capital Federal Argentina

Re: MS-SQL y Fivewin

Postby Compuin » Wed Mar 16, 2016 4:28 pm

Gracias Horacio

Tienes algun ejemplo?
FWH 20.12
Hbmk2 32/64 Bits (Build 19.29.30133)
Microsoft Visual C 32 Bits
MySql 8.0.24 32/64 Bits
VS Code
Compuin
 
Posts: 1214
Joined: Tue Dec 28, 2010 1:29 pm
Location: Quebec, Canada

Re: MS-SQL y Fivewin

Postby Antonio Linares » Wed Mar 16, 2016 4:30 pm

regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42076
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: MS-SQL y Fivewin

Postby Compuin » Wed Mar 16, 2016 4:44 pm

Gracias Antonio,

Lo revisare
FWH 20.12
Hbmk2 32/64 Bits (Build 19.29.30133)
Microsoft Visual C 32 Bits
MySql 8.0.24 32/64 Bits
VS Code
Compuin
 
Posts: 1214
Joined: Tue Dec 28, 2010 1:29 pm
Location: Quebec, Canada

Re: MS-SQL y Fivewin

Postby horacio » Wed Mar 16, 2016 4:49 pm

Entra en este link

http://www.connectionstrings.com/sql-server/

Este es el código de conexión para mysql

Code: Select all  Expand view

oVarGlobales : oCon := CreateObject("ADODB.Connection")
oVarGlobales : oCon : Open := ( "Driver={MySQL ODBC 5.1 Driver};Server=" + cHost + ";Database=mysql;User=" + cUser + ";Password=" + cPassw + ";Option=3;" )
 


Reemplaza por la cadena de conexión de Ms-Sql

Saludos
horacio
 
Posts: 1363
Joined: Wed Jun 21, 2006 12:39 am
Location: Capital Federal Argentina

Re: MS-SQL y Fivewin

Postby Compuin » Wed Mar 16, 2016 4:54 pm

Gracias Horacio
FWH 20.12
Hbmk2 32/64 Bits (Build 19.29.30133)
Microsoft Visual C 32 Bits
MySql 8.0.24 32/64 Bits
VS Code
Compuin
 
Posts: 1214
Joined: Tue Dec 28, 2010 1:29 pm
Location: Quebec, Canada

Re: MS-SQL y Fivewin

Postby Marco Augusto » Wed Mar 16, 2016 5:13 pm

otro ejemplo

oApp:ConnectionString := "Driver={SQL Server};Server=192.168.1.100;" + ;
"Trusted_Connection=no;Database=polizas" + ;
";Uid=contab;Pwd=Polizas123;"
Marco Augusto Rodriguez Manzo
FWH January 2020 Xharbour 1.2.3
MySQL 5.0.19 Fastreport

PERZO SOFT
Sistemas Personalizados
User avatar
Marco Augusto
 
Posts: 144
Joined: Wed Oct 12, 2005 1:03 pm
Location: Cuernacava, Morelos Mexico

Re: MS-SQL y Fivewin

Postby nageswaragunupudi » Thu Mar 17, 2016 7:38 am

When we use FWH, there is no need to search any where for connection strings,etc. FWH makes using ADO very simple.
Here is a working example on my computer
Code: Select all  Expand view
  ADOCONNECT oCn TO MSSQL SERVER GNRHP\SQLEXPRESS database FWH USER SA PASSWORD mypwd
   // where server is "GNRHP\SQLEXPRESS', database is "FWH", usernaem is "SA' and password is "mypwd"
   
   if oCn == nil
      MsgIbfo( "failed to connect" )
      return nil
   else
      aTables := FW_AdoTables( oCn )
      XBROWSER aTables // show list of tables in database
     
      oRs   := FW_OpenRecordSet( oCn, "CUSTOMER" )
      XBROWSER oRs AUTOSORT  // open and show one tablee
      oRs:Close()
      oCn:Close()
   endif
 
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10620
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: MS-SQL y Fivewin

Postby Compuin » Sat Mar 19, 2016 2:03 am

Antonio,

Con Fivedbu me arroja el siguiente error

Application
===========
Path and name: D:\fivedbu_20140730\fivedbu.exe (32 bits)
Size: 5,550,080 bytes
Compiler version: Harbour 3.2.0dev (r1406271520)
FiveWin Version: FWH 14.06
Windows version: 6.1, Build 7600

Time from start: 0 hours 0 mins 14 secs
Error occurred at: 18/03/2016, 21:40:24
Error description: Error BASE/1004 No exported method: OPENSCHEMA
Args:
[ 1] = U
[ 2] = N 20

Stack Calls
===========
Called from: => OPENSCHEMA( 0 )
Called from: C:\fwteam\samples\fivedbu.prg => ADOOPEN( 473 )
Called from: C:\fwteam\samples\fivedbu.prg => (b)BUILDMENU( 132 )
Called from: .\source\classes\MRU.PRG => (b)TMRU_NEW( 68 )
Called from: .\source\classes\MENU.PRG => TMENU:COMMAND( 467 )
Called from: .\source\classes\WINDOW.PRG => TWINDOW:COMMAND( 1062 )
Called from: .\source\classes\MDIFRAME.PRG => TMDIFRAME:COMMAND( 255 )
Called from: => TMDIFRAME:HANDLEEVENT( 0 )
Called from: .\source\classes\WINDOW.PRG => _FWH( 3291 )
Called from: => WINRUN( 0 )
Called from: .\source\classes\WINDOW.PRG => TMDIFRAME:ACTIVATE( 1015 )
Called from: C:\fwteam\samples\fivedbu.prg => MAIN( 57 )

Es una Base de Datos sencilla con 2 tablas
FWH 20.12
Hbmk2 32/64 Bits (Build 19.29.30133)
Microsoft Visual C 32 Bits
MySql 8.0.24 32/64 Bits
VS Code
Compuin
 
Posts: 1214
Joined: Tue Dec 28, 2010 1:29 pm
Location: Quebec, Canada


Return to FiveWin para Harbour/xHarbour

Who is online

Users browsing this forum: Julio Cepeda and 86 guests