If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
DAO error
The following code worked for a while and now I get an error:
Couldn't create; no modify design permission for table or query Any Ideas. Thanks in advance. Max Sub CreateOpNoteTable(strDBName) 'This creates a new table in an external database using DAO and adds the fields Dim dbsLogdat As Database, tdfNew As TableDef, idx As Index, fld1 As Field Set dbsLogdat = OpenDatabase(strDBName, False, False, ";pwd=admin") Set tdfNew = dbsLogdat.CreateTableDef("PatientOpNoteTemp",,,";p wd=admin")) With tdfNew .Fields.Append .CreateField("OpNoteID", dbLong) Set idx = .CreateIndex("OpNoteIDIndex") Set fld1 = idx.CreateField("OpNoteID") fld1.Attributes = dbAutoIncrField idx.Fields.Append fld1 idx.Required = True idx.Unique = True idx.Primary = True .Indexes.Append idx .Fields.Append .CreateField("PatientID", dbLong) .Fields.Append .CreateField("EpisodeID", dbLong) .Fields.Append .CreateField("OpDate", dbDate) ' Append the new TableDef object to the database. dbsLogdat.TableDefs.Append tdfNew End With dbsLogdat.Close End Sub |
#2
|
|||
|
|||
Don't worry, I have fixed it using the following:
Set MyWs = DBEngine.Workspaces(0) Set MyDb = MyWs.OpenDatabase(Filename, False, False, ";pwd=admin") Max "Max" wrote in message ... The following code worked for a while and now I get an error: Couldn't create; no modify design permission for table or query Any Ideas. Thanks in advance. Max Sub CreateOpNoteTable(strDBName) 'This creates a new table in an external database using DAO and adds the fields Dim dbsLogdat As Database, tdfNew As TableDef, idx As Index, fld1 As Field Set dbsLogdat = OpenDatabase(strDBName, False, False, ";pwd=admin") Set tdfNew = dbsLogdat.CreateTableDef("PatientOpNoteTemp",,,";p wd=admin")) With tdfNew .Fields.Append .CreateField("OpNoteID", dbLong) Set idx = .CreateIndex("OpNoteIDIndex") Set fld1 = idx.CreateField("OpNoteID") fld1.Attributes = dbAutoIncrField idx.Fields.Append fld1 idx.Required = True idx.Unique = True idx.Primary = True .Indexes.Append idx .Fields.Append .CreateField("PatientID", dbLong) .Fields.Append .CreateField("EpisodeID", dbLong) .Fields.Append .CreateField("OpDate", dbDate) ' Append the new TableDef object to the database. dbsLogdat.TableDefs.Append tdfNew End With dbsLogdat.Close End Sub |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Error 3270 Property not found | Nelson | Setting Up & Running Reports | 9 | August 2nd, 2004 11:53 PM |
Reserved Error 1517 | SJH | General Discussion | 6 | July 13th, 2004 07:25 PM |
problems initiating mplay32.exe | electricrainbowfish | Powerpoint | 8 | July 8th, 2004 09:37 AM |
error 3011-msaccess | Lalit H Kokku | New Users | 1 | July 6th, 2004 03:34 AM |
sending error -- anyone up to challenge? | Roxy | Outlook Express | 18 | June 30th, 2004 11:01 PM |