473,748 Members | 2,847 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to create non-unique index with DDL?

I'd like to use DDL (Data Definition Language) rather than VBA code to create a
new table. The below DDL statement creates the table very nicely:

CREATE TABLE tblTx03 (Subject Text (100), Entity_ID Long, TxDate Date, Tx_ID
AutoIncrement Constraint PrimaryKey PRIMARY KEY);

The problem is I want a non-unique index on TxDate - can this be done in the
same statement?

Or do I need to run a separate statement to add the non-unique index?

CREATE INDEX idxTxDate ON tblTx03 ( TxDate ASC );

Thanks in advance.
Nov 12 '05 #1
2 7582
On Jan 29 2004, 11:48 am, "deko" <dj****@hotmail .com> wrote in
news:GP******** *********@newss vr29.news.prodi gy.com:
I'd like to use DDL (Data Definition Language) rather than VBA code to
create a new table. The below DDL statement creates the table very
nicely:

CREATE TABLE tblTx03 (Subject Text (100), Entity_ID Long, TxDate
Date, Tx_ID
AutoIncrement Constraint PrimaryKey PRIMARY KEY);

The problem is I want a non-unique index on TxDate - can this be done
in the same statement?
According to Help, only unique or primary key indexes can be specified in
the CREATE TABLE statement in Jet, both 3.5 and 4.0.
Or do I need to run a separate statement to add the non-unique index?

CREATE INDEX idxTxDate ON tblTx03 ( TxDate ASC );


This will do it. You may want to wrap both statements in a transaction.

--
(remove a 9 to reply by email)
Nov 12 '05 #2
10-4

I discovered Microsoft Knowledge Base Article 180841, which is also helpful...

"Dimitri Furman" <df*****@cloud9 9.net> wrote in message
news:Xn******** *************** *****@127.0.0.1 ...
On Jan 29 2004, 11:48 am, "deko" <dj****@hotmail .com> wrote in
news:GP******** *********@newss vr29.news.prodi gy.com:
I'd like to use DDL (Data Definition Language) rather than VBA code to
create a new table. The below DDL statement creates the table very
nicely:

CREATE TABLE tblTx03 (Subject Text (100), Entity_ID Long, TxDate
Date, Tx_ID
AutoIncrement Constraint PrimaryKey PRIMARY KEY);

The problem is I want a non-unique index on TxDate - can this be done
in the same statement?


According to Help, only unique or primary key indexes can be specified in
the CREATE TABLE statement in Jet, both 3.5 and 4.0.
Or do I need to run a separate statement to add the non-unique index?

CREATE INDEX idxTxDate ON tblTx03 ( TxDate ASC );


This will do it. You may want to wrap both statements in a transaction.

--
(remove a 9 to reply by email)

Nov 12 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
13061
by: Shashikant Khandelwak | last post by:
Hi ! I am trying to install oracle 9i Standard edition on a windows 2000 SP4 machine. I get through the entire installation up to running the Database Configuration Assistant. While it tries to make the database, it gets to the "Creating and starting Oracle instance" stage, and then the errors start. I get: ORA-01503: CREATE CONTROLFILE failed. ORA-00205: error in identifying control file. check alertlog for more
3
3038
by: John | last post by:
Hi, I am a beginner looking for example code on how to create an access database for a local application. I need to create the database when the app is first installed. I can do it with SQL 2000 but I am not sure how to do create a db, tables and fields as a local mdb. Any help or pointers to where I can find example code on this much appreciated. Thanks John
4
8448
by: simduss | last post by:
Hi, First of all, I'm a beginner with Unix. I have a "make" (Unix command) problem with a Pro*C sub-program since I installed Oracle8i (before I was at 7.3.4). I have a script builder that generate a makefile (that include env_precomp.mk) and launch this makefile after. So, I receive this error: make: 1254-002 Cannot find a rule to create target /u02/apps_r/dev/ben/lib/fcfz02.a from dependencies.
0
1437
by: Joel Foner | last post by:
I realize this sounds like a bizarre question, but... is it possible to create an MFC window as a child of a non-MFC parent? Here's the background. I'm trying to create an add-in for a product that was built using an old Mac to Windows porting library called Mac2Win. This library apparently has you develop on the Mac and then does an API translation so that it compiles on Win32. Here's the problem: - Main app creates a window with some...
11
1567
by: Gene | last post by:
I want to create a certain number of arrays on the same time to use, is it possible to do that?
14
302
by: foxchan | last post by:
A Newbie question. Is it possible? Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Dim oNewForm As Form1 'if already create a form for form.text="JustOne" then JustOne.show() 'else oNewForm = New Form() oNewForm.Text = "JustOne"
19
2335
by: Brett Romero | last post by:
Here's a table of data I'm putting into a collection: CodeId CodeGroup CodeSubGroup Type 1 K K.1 Shar1 2 K K.1 MD5 3 J J.2 Shar1 I want to get the data in two ways: Codes codes;
1
1244
by: Tom O'Brien | last post by:
hello, This is a basic questions... i have just started using vb.... I want to figure out how to create a range dynamically. Say I have some data in a variable number of columns, in this example 3 - A, B, & C Eg.
15
5276
by: lxyone | last post by:
Using a flat file containing table names, fields, values whats the best way of creating html pages? I want control over the html pages ie 1. layout 2. what data to show 3. what controls to show - text boxes, input boxes, buttons, hyperlinks ie the usual. The data is not obtained directly from a database.
0
1363
by: =?Utf-8?B?QmFydE1hbg==?= | last post by:
Greetings, To begin with we have an archetecture which has a manager Asssembly which loads "Plug-in" assemblies using reflection, when a the UI prompts the manager. This loading of the assemblies and initialization is done in a seperate thread from the UI, to keep the UI from being locked up. Unfortuately 1 of the plug in assemblies provides a interface to a 3rd party
0
8991
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8831
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9548
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9374
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9325
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9249
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
4607
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4876
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3315
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.