create tables in MS Access through VB6
Using VB6 and MS Access 2003. I would like to create a simple table in the database. I'm able to do this fine... but here's the catch. I want to create an AutoNumbering Index in my table as a Primary Key. How do I do
that? I can make it a Primary Key, but can't seem to set the datatype as autonumbering.
Second. How do I create a field that is a Lookup table query? Can this be accomplished via VB6?
My current DB interactions are ADO... but could use DAO if that is better...
I have had little to no luck in my searches on the Internet.
either run create table queries or else TableDefs.Add
if you're new to this then try it out from within an access module to see how it works, then you can add a reference to DAO in vb and copy in your code.
Also this: VB code for creating access
Private Sub Form_Load()
Const strConnection As String = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Documents and Settings\n13437\My Documents\db1.mdb;Persist Security Info=False"
Dim cnn As New ADODB.connection
Dim cmd As New ADODB.Command
cnn.ConnectionString = strConnection
cmd.ActiveConnection = cnn
cmd.CommandText = "create table tnn1 (a varchar(10), b number)"
|Tags: create, tables, vb6|
|Thread Tools||Search this Thread|
|Similar Threads for: "create tables in MS Access through VB6"|
|Thread||Thread Starter||Forum||Replies||Last Post|
|How To Create Tables in Flash||sweetsriheart||Software Development||1||03-09-2010 05:18 PM|
|How to create MySQL Database and Tables in PHP?||Orton||Software Development||4||23-02-2010 06:45 AM|
|How to create table and Modify tables in Microsoft Access 2007||Antonio1||Windows Software||7||27-11-2009 12:31 AM|
|Sample database script to create tables||Naresh Modi||Software Development||3||12-08-2009 02:17 PM|
|How to create Tables in HTML ?||Sudra||Software Development||2||21-02-2009 09:01 AM|