Results 1 to 6 of 6

Thread: Creating a Database

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    May 2000
    Location
    Mexico City
    Posts
    242

    Question

    Hi,

    I'm a newbie with databases, and I want to know how can I create a new database using ADO...Note that I'm not very familiar with the SQL language...

    Thanks!

  2. #2
    Frenzied Member
    Join Date
    Aug 1999
    Location
    Santa Clara, Ca , 95058
    Posts
    1,105
    What DBMS are you using? SQL Server allows you to send DDL via a TSQL statement that could create a database, as long as the server is defined...

  3. #3

    Thread Starter
    Addicted Member
    Join Date
    May 2000
    Location
    Mexico City
    Posts
    242
    What???

    I don't want to be silly, but I didn't really understood what are you talking about...after all, I'm still a newbie :-)

    Well, if this helps, I'm using VB6, and ADO 2.5. And I'm working with an Access 2000 database, so no SQL Server. Although I'm aware I must use SQL syntax to use ADO, right?

    Thanks for any help!

  4. #4
    Frenzied Member
    Join Date
    Aug 1999
    Location
    Santa Clara, Ca , 95058
    Posts
    1,105
    T-SQL is TransactSQL, basically an extended version of ANSI-SQL. DDL is Data Description Language, it's what you use to describe/build a database (DML, the other piece of DBMS's, is data manipulation language. Or in simpler terms, queries). You can use DDL in DAO to create an Access database but I'm not sure how you'd do it in ADO.

  5. #5
    Guru Clunietp's Avatar
    Join Date
    Oct 1999
    Location
    USA
    Posts
    1,844
    Create a database using ADO:
    Code:
    'uses ADO 2.x for DDL and security
    Dim strConnectionStringOfNewDB As String
    Dim objCat As ADOX.Catalog
    
    'instantiate catalog object
    Set objCat = New ADOX.Catalog
    
    'connection string of new db -- includes driver/db type and location
    strConnectionStringOfNewDB = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\NewDB.mdb"
    
    'create it
    objCat.Create strConnectionStringOfNewDB
    
    'cleanup
    Set objCat = Nothing

  6. #6

    Thread Starter
    Addicted Member
    Join Date
    May 2000
    Location
    Mexico City
    Posts
    242

    Thumbs up

    Hey, thanks a lot!

    It works like a charm.

    Now, I have a few more questions, but I don't think anyone is going to give me a tutorial about this, so... any good sources to learn ADO? preferably online, because there aren't any good books in my country, and buying them from somewhere else will take long...

    thanks again

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