Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 174
  • Last Modified:

Create a Access Database in VB6

I would like some help on creating an Access 2000 Database with tables and fields in vb code.
0
nongravity
Asked:
nongravity
1 Solution
 
VBSysCOM1Commented:
1.) What data control are you going to use.
2.) What sevice pack is installed



Thank You Have A Good Day!
0
 
nongravityAuthor Commented:
I am running VB6 SP5.  ADO control.
0
 
bobbit31Commented:
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
 
Éric MoreauSenior .Net ConsultantCommented:
0
 
bobbit31Commented:
emoreau: nice link!
0

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now