Question about Oracle 10g Database Standard (ODBSEONUPP0)
How to writ the code in visual basic to create database in Ms Access
The standard way of creating a database using VBA, which can be modified to suit your needs is this--> Note: the code (wspDefault.CreateDatabase("Newdb.mdb"...), can be altered to save the database in a folder such as "C:\NEWDB\text.mdb". sub NewDatabase() Dim wspDefault As Workspace, dbs As Database Dim tdf As TableDef, fld1 As Field, fld2 As Field Dim idx As Index, fldIndex As Field Set wspDefault = DBEngine.Workspaces(0) ' Create new, encrypted database. Set dbs = wspDefault.CreateDatabase("Newdb.mdb", _ dbLangGeneral, dbEncrypt) ' Create new table with two fields. Set tdf = dbs.CreateTableDef("Contacts") Set fld1 = tdf.CreateField("ContactID", dbLong) fld1.Attributes = fld1.Attributes + dbAutoIncrField Set fld2 = tdf.CreateField("ContactName", dbText, 50) ' Append fields. tdf.Fields.Append fld1 tdf.Fields.Append fld2 ' Create primary key index. Set idx = tdf.CreateIndex("PrimaryKey") Set fldIndex = idx.CreateField("ContactID", dbLong) ' Append index fields. idx.Fields.Append fldIndex ' Set Primary property. idx.Primary = True ' Append index. tdf.Indexes.Append idx ' Append TableDef object. dbs.TableDefs.Append tdf dbs.TableDefs.Refresh Set dbs = Nothing End Sub
Hope this helps! Please let me know if you have any questions.Thank You,Raph30
Posted on Jan 24, 2009
a 6ya expert can help you resolve that issue over the phone in a minute or two.
best thing about this new service is that you are never placed on hold and get to talk to real repairmen in the US.
the service is completely free and covers almost anything you can think of (from cars to computers, handyman, and even drones).
click here to download the app (for users in the US for now) and get all the help you need.
Posted on Jan 02, 2017
Tips for a great answer:
May 31, 2010 | Microsoft Visual FoxPro Professional...
Jun 16, 2009 | Microsoft Visual Basic Enterprise Edition...
May 14, 2009 | Microsoft Visual Basic Professional...
Mar 26, 2009 | Microsoft Visual Basic 6.0 for PC
Mar 09, 2009 | Microsoft Press MS Access 2000 and Visual...
Mar 02, 2009 | Microsoft Visual Basic 6.0 for PC
Feb 17, 2009 | Microsoft Visual Basic Professional...
Feb 17, 2009 | Microsoft Visual Basic 6.0 for PC
Nov 10, 2007 | Oracle 10g Database Standard (ODBSEONUPP0)
235 people viewed this question
Usually answered in minutes!
Step 2: Please assign your manual to a product: