Results 1 to 6 of 6

Thread: Create DB without Access

  1. #1

    Thread Starter
    Fanatic Member joltremari's Avatar
    Join Date
    Sep 2000
    Location
    Mississippi
    Posts
    674

    Create DB without Access

    I found a tutorial one time that showed an example of how to create a MS Access DB with a vb app but the user did not have to have Access installed on their machine.

    Can someone provide an example or explanation of this or maybe point me toward some info.

    Any help is appreciated,
    JO
    "I have not failed. I've just found 10,000 ways that won't work."
    'Thomas Edison'

    "If we knew what it was we were doing it wouldn't be called research, would it?"
    'Albert Einstein'

    VB6

  2. #2
    -= B u g S l a y e r =- peet's Avatar
    Join Date
    Aug 2000
    Posts
    9,629
    it is correct, ms access do not have to be installed.

    you can use ADO and ADOX in order to retreive, view and edit data, and also to maintain and create databases.

    sample

    VB Code:
    1. 'Add a reference to Microsoft ADO Ext. X.X For DLL And Security
    2.  
    3. Option Explicit
    4. Dim cat As ADOX.Catalog
    5. Dim tbl As ADOX.Table
    6.  
    7. Private Sub Command1_Click()
    8.     Set cat = New ADOX.Catalog
    9.     Set tbl = New ADOX.Table
    10.  
    11.     ' create the db
    12.     cat.Create "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=c:\newDB3.mdb"
    13.    
    14.     With tbl
    15.       .Name = "TestTable"
    16.       ' Create fields and append them to the
    17.       ' Columns collection of the new Table object.
    18.       With .Columns
    19.          .Append "ID COLUMN"
    20.          .Append "SetName", adVarWChar, 255
    21.          .Append "SetVal", adVarWChar, 255
    22.          .Append "Description", adVarWChar, 255
    23.       End With
    24.    End With
    25.    
    26.    ' Add the new Table to the Tables collection of the database.
    27.    cat.Tables.Append tbl
    28.    
    29.    'Set AllowZeroLength to true for the SetName field
    30.    tbl.Columns("SetName").Properties("Jet OLEDB:Allow Zero Length") = True
    31.    
    32.    Set cat = Nothing
    33.    Set tbl = Nothing
    34.    
    35. End Sub
    -= a peet post =-

  3. #3
    -= B u g S l a y e r =- peet's Avatar
    Join Date
    Aug 2000
    Posts
    9,629
    use some of these links to learn more about ado, or do a search on the web... there must be thousands of tutorials on this issue

    http://www.devguru.com/Technologies/...ado_intro.html
    http://www.vbworld.com/databases/
    http://www.codeguru.com/vb/Database/ADO/index.shtml
    http://www.able-consulting.com/ADO
    -= a peet post =-

  4. #4

    Thread Starter
    Fanatic Member joltremari's Avatar
    Join Date
    Sep 2000
    Location
    Mississippi
    Posts
    674
    Thats great info!
    I am familiar with ado but with existing databases.

    Thanks for the info!
    "I have not failed. I've just found 10,000 ways that won't work."
    'Thomas Edison'

    "If we knew what it was we were doing it wouldn't be called research, would it?"
    'Albert Einstein'

    VB6

  5. #5
    -= B u g S l a y e r =- peet's Avatar
    Join Date
    Aug 2000
    Posts
    9,629


    seems my links are a bit old, (2 not working ) sorry about that
    -= a peet post =-

  6. #6
    Frenzied Member
    Join Date
    Jan 2000
    Location
    Brooklyn NY USA
    Posts
    1,258
    And you can use DAO too. Just search the help files.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width