Solved

Create a Access Database in VB6

Posted on 2001-06-19
5
167 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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Determine Range to Select 5 55
Crystal reports - Formula Field code need assistance with code 17 90
TT Auto Dashboard 13 100
IF ELSE Statement in Excel Macro VBA 16 87
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…
The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

685 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