INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Jobs

How to create a database from scratch with VB6?

How to create a database from scratch with VB6?

(OP)
Hey all,

I'm trying to create an app with VB6 that requires the creation of a database, tables, etc. for a Windows XP environment and above AND regardless of whether or not the end user has MS Access.

I've worked with databases before via PHP/MySQL so I know certain concepts. Also, my skill level with vb6 is ok; but I've never done anything with databases.

I've come across several tutorials discussing creation of a database via code such as the following:

'Dim catNewDB ' As ADOX.Catalog
Dim catNewDB As Object
'Set catNewDB = Server.CreateObject("ADOX.Catalog")'... etc.

However, I'm not quite understanding the concept of DB creation using VB6. I know there's a CreateDatabase Method that creates a database object; but I'm not sure how it ties into creating the elements of a database and inputting data.

Can anyone point me in the right direction as to how to create a database with vb6 from scratch? Or, at least, give me the 'quick and dirty'?

Any and all help is greatly appreciated.

Peace!
- Thank You Have A Nice Day
 

RE: How to create a database from scratch with VB6?

You may want to 're-think' WHY you need to create a new database.  Often times it is easier to distribute a blank database with your application.  Every time you need a 'new' database, simply copy the blank database to a new file named whatever you like.  You suddenly have a new database with the tables already created and you could even have data in some tables (think look up tables).

Copying a file to create a new database is a lot easier this way.

-George

"The great things about standards is that there are so many to choose from." - Fortune Cookie Wisdom

RE: How to create a database from scratch with VB6?

(OP)

Thanks vb5!

Read your comments on post #13 about how MS forgot to include CreateDatabase method -- funny : ))

BTW, can you also recommend any online tutorials for database development concepts with VB6?

Thanks again.

- Tyhand

 

RE: How to create a database from scratch with VB6?

There really should not be any "database development concepts with vb6" tutorials out there because a database and any programming language are two different beasts.

Database development and design is a beast of its own with its own rules, strategies, and concepts for it to reach its optimal performance, and this has nothing to do with any programming language. It is meant to hold data, relational or otherwise, in the most efficient way it can based upon the design of the database.

Each DBMS has its own pluses and minuses but what they do have in common is the SQL language (pronounced Sequel). SQL has a syntax of its own, like VB or C++, that allows you not only to access, add, edit, and delete data stored within the database, but to alter the structure of the database itself and it is up to the DBMS to interpret these commands and execute them to the best of its abilities.

Then each DBMS has its own protocols for receiving these commands and sending any results of executing those commands, and while those interfaces follow the same rules, each is just a little bit different. That is why each DBMS has a set of drivers or dlls that do have a common interface and it is this interface that programming languages like VB access when they use DAO, RDO, or ADO. This common interface can be found, at least visually, with the ODBC DSN Administrator/manager.

Speaking of ADO, ADO is a wrapper for both RDO and DAO to give the VB programmer a common interface because back in the day before ADO, one had to change their code from DAO to RDO depending upon if they were accessing Access or M$'s SQL Server. That is unless one used either DAO ODBC Direct, or RDO with an ODBC DSN as RDO. Then just a note of history, RDO has the same ability to use a DSN Less connection string as ADO. Where do you think ADO got that ability from?

So, here at the end of this longish post, is the advice to search for SQL tutorials, and you will find some out there with "programming language name SQL Tutorial" (VB6 SQL Tutorial) and even more with vb6 ADO Tutorial as one must know at least a little SQL to access the data stored in the database of choice. Then for database development there are keyword phrases like 3rd normal form, database design (you could also add the keyword concepts to each of those), and of course you could get specific with DBMS name design concepts (Access design concepts, SQL Server design concepts).



Good Luck

 

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Resources

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close