FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin para Harbour/xHarbour Conexion SQLserver
Posts: 199
Joined: Fri Apr 18, 2008 04:21 PM
Conexion SQLserver
Posted: Wed Jun 30, 2010 05:26 PM

Hola a todos,

Necesito saber como hacer una conexion a SQL server sin Odbc.

Si es asi como hago la conexion y un ejemplo y de donde puedo bajar la clase para hacerlo?

tambien necesito como hacer altas,bajas y cambios a la base de datos SQLserver.

de antemano muy agradecido.

Atentamente
Julio Ponce

Posts: 1335
Joined: Fri Jun 13, 2008 11:04 AM
Re: Conexion SQLserver
Posted: Thu Jul 01, 2010 05:28 AM
I am not sure whether this is your requirement or not

The ADO way.
If you are trying to connect to a MS SQL Server database, then you don't have to install any additional ODBC drivers. Windows comes pre-installed with MDAC.
Here is the code to connecto to a MS Sql Database
Code (fw): Select all Collapse
TRY
  oConnection:=CreateObject("ADODB.Connection")
CATCH
  MsgInfo("It seems that your PC does not have MDAC installed OR MDAC is corrupted."+CRLF+;
          "Please contact IT Dept.")
  Return .F.
END
oConnection:ConnectionString:="Provider=SQLOLEDB;server=YourServerIP;database=YourDatabaseName;uid=UserName;pwd=Password" 
TRY 
  oConnection:Open()
CATCH
  MsgInfo("Failed to Connect to the Database available in the Internet."+CRLF+;
           "Please check whether internet is available in your PC","Unable to connect")
  Return .F.

END


Regards
Anser
Posts: 199
Joined: Fri Apr 18, 2008 04:21 PM
Re: Conexion SQLserver
Posted: Thu Jul 01, 2010 06:09 PM

OK muchas gracias voy a probar.

Y como puedo hacer el tratamiento de los datos, es decir consultar, insertar,modificar y como desplegar en un tsbrowse las consultas.

Atentamente
Julio Ponce

Continue the discussion