Creating Index
From: Michael A. Gunther (guntherm_at_chuckals.net)
Date: 01/14/05
- Next message: Dale: "Re: Creating Index"
- Previous message: Douglas J. Steele: "Re: Receiving 3077 Date syntax error from international users"
- Next in thread: Dale: "Re: Creating Index"
- Reply: Dale: "Re: Creating Index"
- Reply: Dale: "Re: Creating Index"
- Reply: Dale: "Re: Creating Index"
- Messages sorted by: [ date ] [ thread ]
Date: Fri, 14 Jan 2005 07:34:46 -0800
I can create the new table inthe access form, however it will not allow me
to create the index. what am I missing. I took this code out of another
program I already use and it works fine. I am using DAO, and VB6 and DAO Lib
3.6. the table is fine, but it always give me Method or memebr not found
when it hits the createfield in the index portion of the code..
Dim datdatabase As DAO.Database
Dim tdfReleaseNew As DAO.TableDef
Dim idxTemp As Index
Set datdatabase = OpenDatabase(gstrDB_Path, , False)
'Create Tables on the Fly
Set tdfReleaseNew = datdatabase.CreateTableDef("ReleaseNotes")
On Local Error Resume Next
With tdfReleaseNew
.Fields.Append .CreateField("RecordID", dbInteger, 10)
.Fields("RecordID").AllowZeroLength = True
.Fields.Append .CreateField("Version", dbText, 20)
.Fields("Version").AllowZeroLength = True
.Fields.Append .CreateField("Date", dbDate)
.Fields("Date").AllowZeroLength = True
.Fields.Append .CreateField("Comments", dbText, 255)
.Fields("Comments").AllowZeroLength = True
.Fields.Append .CreateField("NewNote", dbBoolean)
.Fields("NewNote").AllowZeroLength = True
datdatabase.TableDefs.Append tdfReleaseNew
With tdfReleaseNew
Set idxTemp = .CreateIndex("Primary")
With idxTemp
.Fields.Append .CreateField("RecordID")
.Primary = True
.Unique = True
End With
.Indexes.Append idxTemp
End With
'Commented out to Delete Table if need be ------
datdatabase.TableDefs.Delete "New Records"
- Next message: Dale: "Re: Creating Index"
- Previous message: Douglas J. Steele: "Re: Receiving 3077 Date syntax error from international users"
- Next in thread: Dale: "Re: Creating Index"
- Reply: Dale: "Re: Creating Index"
- Reply: Dale: "Re: Creating Index"
- Reply: Dale: "Re: Creating Index"
- Messages sorted by: [ date ] [ thread ]