H
Helmut Forren
I'm fairly familiar with SQL in general, as well as with
Access in general, but I haven't done too much SQL in VB5,
using the Microsoft Jet Engine (I assume), to access an
Access 97 database.
I MUST leave the database in Access 97, and I MUST add a
new table from my VB5 program. The primary key needs to
be of type Autonumber (Long Integer). This is all in a
program I've inherited.
I've gotten as far as the following code, to add a long
integer primary key that is NOT autonumbered or
AUTO_INCREMENT:
Public gdbRaceBase As Database
...
Dim strSQL As String
...
strSQL = "CREATE TABLE tblMaintenance _
(lMaintenance_id Integer NOT NULL)"
gdbRaceBase.Execute strSQL
strSQL = "ALTER TABLE tblMaintenance ADD CONSTRAINT _
lMaintenance_id_key PRIMARY KEY (lMaintenance_id)"
gdbRaceBase.Execute strSQL
So, the above creates the table with the primary key as
long integer. Now what SQL statement do I use, or how do
I modify the above, to make that key AutoNumber like it
would be were I allowed to simply modify the database from
the Access IDE?
Thanks very much,
Helmut
Access in general, but I haven't done too much SQL in VB5,
using the Microsoft Jet Engine (I assume), to access an
Access 97 database.
I MUST leave the database in Access 97, and I MUST add a
new table from my VB5 program. The primary key needs to
be of type Autonumber (Long Integer). This is all in a
program I've inherited.
I've gotten as far as the following code, to add a long
integer primary key that is NOT autonumbered or
AUTO_INCREMENT:
Public gdbRaceBase As Database
...
Dim strSQL As String
...
strSQL = "CREATE TABLE tblMaintenance _
(lMaintenance_id Integer NOT NULL)"
gdbRaceBase.Execute strSQL
strSQL = "ALTER TABLE tblMaintenance ADD CONSTRAINT _
lMaintenance_id_key PRIMARY KEY (lMaintenance_id)"
gdbRaceBase.Execute strSQL
So, the above creates the table with the primary key as
long integer. Now what SQL statement do I use, or how do
I modify the above, to make that key AutoNumber like it
would be were I allowed to simply modify the database from
the Access IDE?
Thanks very much,
Helmut