¿ Alguien sabe como poder configurar automaticamente un ODBC (p.e. una conexion a Acces) desde dentro la aplicación ? (O sea, que lo que haces manualmente desde la pantalla de configuracion de ODBC's hacerlo con alguna funcion interna)
Gracias !!!
![Smile :-)](./images/smilies/icon_smile.gif)
Code: Select all | Expand
#include "Fivewin.ch"
FUNCTION CfgOdbc()
LOCAL nRet,cDriver,cAttribute
cDriver :="Client Access ODBC Driver (32-bit)"
cAttribute:="DSN=BIEL"+Chr(0)+"DESCRIPTION=descipcion"+Chr(0)+"SERVER=192.168.101.1"
nRet:=CrtDtaSrc(0,1,cDriver, cAttribute )
//nRet->0 no se ha creado, 1 creado ok
RETURN NIL
DLL32 FUNCTION CrtDtaSrc(hWnd AS LONG, nRequest AS LONG, @cDriver as STRING , @cAttributes as STRING) ;
AS _INT PASCAL FROM "SQLConfigDataSource" LIB "ODBCCP32"
Rick Lipkin wrote:Carles
Dumb question ... why use ODBC and not ADO ? .. With ODBC you have to configure every workstation your app runs on... ADO uses the built in Ole providers for Sql Server, Ms Access .. for all others, you have to download the Ole Provider for your RDMS.
Rick Lipkin
Rick Lipkin wrote:Carles
Dumb question ... why use ODBC and not ADO ? .. With ODBC you have to configure every workstation your app runs on... ADO uses the built in Ole providers for Sql Server, Ms Access .. for all others, you have to download the Ole Provider for your RDMS.n
Compuin wrote:...
On IT, sometimes is not just click to install an app, it could involve more work than just a installation step.
Carles wrote:Hi,Rick Lipkin wrote:Carles
Dumb question ... why use ODBC and not ADO ? .. With ODBC you have to configure every workstation your app runs on... ADO uses the built in Ole providers for Sql Server, Ms Access .. for all others, you have to download the Ole Provider for your RDMS.n
I know and I agree with you, but my problem is another, believe me
Compuin wrote:...
On IT, sometimes is not just click to install an app, it could involve more work than just a installation step.
Cierto, y el problema esta en una mierda de aplicación de una empresa externa que usa todo el mundo desde hace años y que necesita conectarse via ODBC y es necesario configurar el dns. Claro que si solo hay una maquina se configura y listos, pero en mi caso son unas 180 máquinas y cada vez que se instalan en nuevas ocurre lo mismo.
Es por eso que quiero hacer un pequeño programa en FWH y que chequee si existe en la entrada del dns y en caso contrario generar la parametrizacion del dns. Esto lo aplicaria en una politica de arranque del sistema que se ejecute en 2 plano al iniciar el sistema y listos...