dgoulston
Hasn't Got A Clue
- Local time
- Today, 23:18
- Joined
- Jun 10, 2002
- Messages
- 403
ok here is my code, when it gets to the Set ws = DBEngine.Workspaces(0) line it says
"could not use c:\db.mdb, file allready open"
but of course its open,,, its the database this code is being run from, but i never had this come up before, and even if i comment out that line i get the same error for the next line Set db = CurrentDb()
any ideas?
thanks
DAL
"could not use c:\db.mdb, file allready open"
but of course its open,,, its the database this code is being run from, but i never had this come up before, and even if i comment out that line i get the same error for the next line Set db = CurrentDb()
any ideas?
Code:
Dim tablename As String
Dim db As Database
Dim tdf As TableDef
Set ws = DBEngine.Workspaces(0)
Set db = CurrentDb()
Set tdf = db.CreateTableDef("DNRACS")
Dim tmpnum As Integer
Dim tmplabel()
tmplabel = Array(lblchk1, lblchk2, lblchk3, lblchk4, lblchk5)
'sourcedb = openfiledb("c:\") 'open file diolog
tablename = tmplabel(chkval - 1).Caption 'gets table name from a text box
tdf.Connect = ";DATABASE=" & sourcedb
tdf.SourceTableName = tablename
db.TableDefs.Append tdf[list]
thanks
DAL