Programación General > Visual Basic 6.0 e inferiores

 Re: Crear base de datos

<< < (2/2)

acalanto:
Efectivamente puedes utilizar el método append para crear una base de datos. Además esto lo puedes hacer con FIELDS, INDEXES, RELATIONS y cualquier otro objeto que dependa del objeto DataBase.

Un saludo.

acalanto:
Este elemplo casado de MSDN te puede aclarar alguinos conceptos.

Sub CreateDatabaseX()

   Dim wrkDefault As Workspace
   Dim dbsNew As DATABASE
   Dim prpLoop As Property

   ' Get default Workspace.
   Set wrkDefault = DBEngine.Workspaces(0)

   ' Make sure there isn't already a file with the name of
   ' the new database.
   If Dir("NewDB.mdb") <> "" Then Kill "NewDB.mdb"

   ' Create a new encrypted database with the specified
   ' collating order.
   Set dbsNew = wrkDefault.CreateDatabase("NewDB.mdb", _
      dbLangGeneral, dbEncrypt)

   With dbsNew
      Debug.Print "Properties of " & .Name
      ' Enumerate the Properties collection of the new
      ' Database object.
      For Each prpLoop In .Properties
         If prpLoop <> "" Then Debug.Print "  " & _
            prpLoop.Name & " = " & prpLoop
      Next prpLoop
   End With

   dbsNew.Close

End Sub


Consulta en MSDN <CreateDataBase>;<TableDefs>;<Fields>;<Indexes>;<Relations>

Un saludo

HurryCrack:
Muchas gracias a todos ya esta resuelto el problema, habeis sido de gran ayuda un abrazo.
:hippi:

Navegación

[0] Índice de Mensajes

[*] Página Anterior

Ir a la versión completa