Ver Mensaje Individual
  #1 (permalink)  
Antiguo 21/04/2005, 10:57
lord_zephirott
 
Fecha de Ingreso: diciembre-2004
Mensajes: 40
Antigüedad: 19 años, 5 meses
Puntos: 0
Pregunta Hola a todos necesito ayuda con los atributos de una API de windows!!!!!!!!!!!!!

como lo dice en el titulo necesito que me ayuden con los atributos de una api de windows. esta es "SQLConfigDataSource" y se utiliza de la siguien manera:

Cita:
Option Explicit
Const ODBC_ADD_SYS_DSN = 4 'Agregar origen de datos
Const ODBC_CONFIG_SYS_DSN = 5 'Configurar (modificar) origen de datos
Const ODBC_REMOVE_SYS_DSN = 6 'Quitar origen de datos

Private Declare Function SQLConfigDataSource Lib "ODBCCP32.DLL" (ByVal _
hwndParent As Long, ByVal fRequest As Long, ByVal _
lpszDriver As String, ByVal lpszAttributes As String) As Long

Function Build_SystemDSN(DSN_NAME As String, Db_Path As String)

Dim ret%, Driver$, Attributes$

Driver = "Controlador de Microsoft Access (*.MDB)" & Chr(0)
Attributes = "DSN=" & DSN_NAME & Chr(0)
Attributes = Attributes & "Uid=Admin" & Chr(0) & "pwd=" & Chr(0)
Attributes = Attributes & "DBQ=" & Db_Path & Chr(0)

ret = SQLConfigDataSource(0, ODBC_ADD_SYS_DSN, Driver, Attributes)

'ret es igual a 1 si se realiza correctamente y 0 si hay un error
If ret <> 1 Then
MsgBox "Error al crear DSN"
End If

End Function
lo que necesitaria es el la parte de atributos utilizar una de las opciones que se llama "Don't Optimize Column Width", esta opcion hace que los campos de texto que traigo de la base no se me corten. Si alguno sabe como puedo hacer para agregar esa opcion dentro de la API de windows