Portal    Foro    Buscar    FAQ    Registrarse    Conectarse


Publicar nuevo tema  Responder al tema 
Página 1 de 1
 
 
MS SqlServer
Autor Mensaje
Responder citando   Descargar mensaje  
Mensaje MS SqlServer 
 
Buenas gente.  

Pregunto por si alguno tiene experiencia, o ha visto que posibilidad hay de conectarse por ODBC con gambas a un motor remoto basado en la herramienta de Windows,  MS-SQLServer 2005.
Soy novato todavía y estoy al tanto de las bases de datos preferidas como MySql, pero me topé con un cliente que ya usa ese motor, desde hace un tiempo, y estoy viendo si mis pruebas permiten la conexión directamente o debo migrar dicha base -con todo lo que eso implicaría...-  

En fin, agradeceré cualquier ayuda.
Gracias.
 



 
MVictor - Ver perfil del usuarioEnviar mensaje privado 
Volver arribaPágina inferior
Responder citando   Descargar mensaje  
Mensaje Re: MS SqlServer 
 
Fuente : Foro www.linuxbasic.net -> Foro gambas
Escrito : October 02, 2008, 05:04:50 pm by fredwarren


There are two ways to do this, graphically and by the command line. I will walk through the command line. Having done it that way I could  now figure out the GUI way to do this. In my sample we are going to use a database named Mickey on the server Donald. With Ubuntu Hardy we need to:

Install unixodbc tdsodbc, and libct3

sudo apt-get install unixodbc tdsodbc libct3


Configure the database in freetds by editing /etc/freetds/freetds.conf

[Test]
  host = DONALD
  tds version = 8.0


Configure unixodbc to recognize freetds by editing /etc/odbcinst.ini

[FreeTDS]
  Description - TDS driver (Sysbase/MS SQL)
  Driver = /usr/lib/odbc/libstdsodbc.so
  Setup = /usr/lib/odbc/libtdsS.so
  CPTimeout = 5
  CPResue = 5


Configure odbc to use the freetds database.by editing /etc/odbc.ini

[Test]
  Description = Test Connection to DONALD
  Driver = FreeTDS
  Servername = Test
  Database = Mickey


Note that that Servername in /etc/odbc.ini is the same as the bracketed section title in /etc/freetds/freetds.conf. In our case this means  Servername = Test  and in freedtds.conf [Test]. The test in /etc/odbc.ini is the same as in  the .Host = "Test" in the gambas sample below.

And here is the code I used in gambas

  DIM $hConn AS NEW Connection
  WITH $hConn
    .Type = "odbc"
    .Host = "Test"
    .Login = "your-username"
    .Password = "your-password"

  END WITH
  
  $hConn.Open
  IF ($hConn.Opened = FALSE)
      Message.Error("Error Opening the connection")
      PRINT $hConn.Error
  ELSE
      Message.Info("This really Works")
  ENDIF

Saludos.

pd: GIYF (Google Is Your Friend)
 



 
abarzuaf - Ver perfil del usuarioEnviar mensaje privado 
Volver arribaPágina inferior
Mostrar mensajes anteriores:    
 

Publicar nuevo tema  Responder al tema  Página 1 de 1
 

Usuarios navegando en este tema: 0 registrados, 0 ocultos y 1 invitado
Usuarios registrados conectados: Ninguno


 
Lista de permisos
No puede crear mensajes
No puede responder temas
No puede editar sus mensajes
No puede borrar sus mensajes
No puede votar en encuestas
No puede adjuntar archivos
Puede descargar archivos
No puede publicar eventos en el calendario



  

 

cron