Visual Basic - DSN

Life is soft - evento anual de software empresarial
 
Vista:

DSN

Publicado por <ONI>HCM (92 intervenciones) el 20/12/2001 12:54:16
como creo un dsn para access desde vb, es urgente
Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder

RE:Creación de DSN para Acces

Publicado por El Tiko (97 intervenciones) el 22/12/2001 02:27:24
Saludos desde Costa Rica...

Aka te pongo un ejemplo ke baje hace algun tiempo, espero ke te sirva...

\'PURPOSE: \'CREATES A SYSTEM DSN FOR AN SQL SERVER DATABASE
\'PARAMETERS: \'DSNName = DSN Name
\'ServerName = Name of Server
\'Database = Database to Use
\'RETURNS: True if successful, false otherwise
\'EXAMPLE: CreateSQLServerDSN \"MyDSN\", \"MyServer\", \"MyDatabase\"
Public Function CreateSQLServerDSN(DSNName As String, ServerName As String, Database As String) As Boolean
Dim sAttributes As String
sAttributes = \"DSN=\" & DSNName & Chr(0)
sAttributes = sAttributes & \"Server=\" & ServerName & Chr(0)
sAttributes = sAttributes & \"Database=\" & Database & Chr(0)
CreateSQLServerDSN = CreateDSN(\"SQL Server\", sAttributes)
End Function

\'PURPOSE: \'CREATES A SYSTEM DSN FOR AN ACCESS DATABASE
\'PARAMETERS: \'DSNName = DSN Name
\'DatabaseFullPath = Full Path to .mdb file
\'RETURNS: True if successful, false otherwise
\'EXAMPLE: CreateAccessDSN \"MyDSN\", \"C:\\MyDb.mdb\"
Public Function CreateAccessDSN(DSNName As String, DatabaseFullPath As String) As Boolean
Dim sAttributes As String
\'TEST TO SEE IF FILE EXISTS: YOU CAN REMOVE IF YOU
\'DON\'T WANT IT
If Dir(DatabaseFullPath) = \"\" Then
MsgBox \"Invalid Path\"
Exit Function
End If
sAttributes = \"
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar