Solved

Create a Access Database in VB6

Posted on 2001-06-19
5
166 Views
Last Modified: 2010-05-02
I would like some help on creating an Access 2000 Database with tables and fields in vb code.
0
Comment
Question by:nongravity
5 Comments
 

Expert Comment

by:VBSysCOM1
ID: 6207604
1.) What data control are you going to use.
2.) What sevice pack is installed



Thank You Have A Good Day!
0
 

Author Comment

by:nongravity
ID: 6207623
I am running VB6 SP5.  ADO control.
0
 
LVL 18

Expert Comment

by:bobbit31
ID: 6207664
use the ms access object library (under project/references)
(note: access will have to be installed on the client machine)

to create a new access database:

Dim accApp As New Access.Application
accApp.DBEngine.CreateDatabase "C:\my documents\newDB.mdb", <locale info as string>
accApp.Quit

Dim myCN As New ADODB.Connection
Dim strSQL As String

myCN.open "Provider=Microsoft.Jet.OLEDB.4.0;" & _
          "Data Source=C:\my documents\newDB.mdb;"

strSQL = "Create table tblNew ( field1 text )"
myCN.execute strSQL
myCN.Close

code not tested
0
 
LVL 70

Accepted Solution

by:
Éric Moreau earned 100 total points
ID: 6207699
0
 
LVL 18

Expert Comment

by:bobbit31
ID: 6207750
emoreau: nice link!
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
bit defender blocks good applications 2 101
Best way to parse out a json string in VB6? 10 223
passing parameter in sql procedure 9 65
Set WorkSheet  not Working 9 42
Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

829 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question