MS-SQL y Fivewin

Post Reply
Compuin
Posts: 1017
Joined: Tue Dec 28, 2010 1:29 pm

MS-SQL y Fivewin

Post by Compuin »

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
horacio
Posts: 1270
Joined: Wed Jun 21, 2006 12:39 am
Location: Capital Federal Argentina

Re: MS-SQL y Fivewin

Post by horacio »

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

Saludos
Compuin
Posts: 1017
Joined: Tue Dec 28, 2010 1:29 pm

Re: MS-SQL y Fivewin

Post by Compuin »

Gracias Horacio

Tienes algun ejemplo?
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Re: MS-SQL y Fivewin

Post by Antonio Linares »

Puedes revisar el código fuente de FiveDBU:

https://bitbucket.org/fivetech/fivewin- ... 140730.zip
regards, saludos

Antonio Linares
www.fivetechsoft.com
Compuin
Posts: 1017
Joined: Tue Dec 28, 2010 1:29 pm

Re: MS-SQL y Fivewin

Post by Compuin »

Gracias Antonio,

Lo revisare
horacio
Posts: 1270
Joined: Wed Jun 21, 2006 12:39 am
Location: Capital Federal Argentina

Re: MS-SQL y Fivewin

Post by horacio »

Entra en este link

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

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

Code: Select all

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
Compuin
Posts: 1017
Joined: Tue Dec 28, 2010 1:29 pm

Re: MS-SQL y Fivewin

Post by Compuin »

Gracias Horacio
Marco Augusto
Posts: 122
Joined: Wed Oct 12, 2005 1:03 pm
Location: Cuernacava, Morelos Mexico

Re: MS-SQL y Fivewin

Post by Marco Augusto »

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 2020 Xharbour 1.2.3
MySQL 5.0.19 Fastreport

PERZO SOFT
Sistemas Personalizados
User avatar
nageswaragunupudi
Posts: 8017
Joined: Sun Nov 19, 2006 5:22 am
Location: India
Contact:

Re: MS-SQL y Fivewin

Post by nageswaragunupudi »

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

   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
Compuin
Posts: 1017
Joined: Tue Dec 28, 2010 1:29 pm

Re: MS-SQL y Fivewin

Post by Compuin »

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
Post Reply