Can anyone tell me what's wrong/missing with my coding please? Every time this runs, program terminates with following error message.
Thanks in advance.
Run-time error 3028
Can't start your application. The workgroup information file is missing or opened exclusively by another user.
'###
'Code to create an Access(97) table using DAO and ADO to open it
'###
Dim SysDB As Database
Dim SysTB As TableDef
Dim SysFD As Field
Set SysDB = CreateDatabase("C:\test.MDB", dbLangGeneral & ";UserID=Admin;pwd=pwd"
Set SysTB = SysDB.CreateTableDef("Tb1"
With SysTB
.Fields.Append .CreateField("Field1", dbText, 8)
.Fields("Field_FormID".AllowZeroLength = True
End With
SysDB.TableDefs.Append SysTB
Dim cn As ADODB.Connection
Set cn = New ADODB.Connection
cn.ConnectionString = & _
"Provider=Microsoft.Jet.OLEDB.3.51;" & _
"Persist Security Info=False;" & _
"Data Source=c:\Test.mdb;" & _
"Pwd=MMG"
cn.Open
Dim rs As ADODB.Recordset
Set rs = New ADODB.Recordset
rs.Open "Tb1", cn, adOpenKeyset, adLockOptimistic, adCmdTable
Set frmMain.Adodc1.Recordset = rs
Thanks in advance.
Run-time error 3028
Can't start your application. The workgroup information file is missing or opened exclusively by another user.
'###
'Code to create an Access(97) table using DAO and ADO to open it
'###
Dim SysDB As Database
Dim SysTB As TableDef
Dim SysFD As Field
Set SysDB = CreateDatabase("C:\test.MDB", dbLangGeneral & ";UserID=Admin;pwd=pwd"
Set SysTB = SysDB.CreateTableDef("Tb1"
With SysTB
.Fields.Append .CreateField("Field1", dbText, 8)
.Fields("Field_FormID".AllowZeroLength = True
End With
SysDB.TableDefs.Append SysTB
Dim cn As ADODB.Connection
Set cn = New ADODB.Connection
cn.ConnectionString = & _
"Provider=Microsoft.Jet.OLEDB.3.51;" & _
"Persist Security Info=False;" & _
"Data Source=c:\Test.mdb;" & _
"Pwd=MMG"
cn.Open
Dim rs As ADODB.Recordset
Set rs = New ADODB.Recordset
rs.Open "Tb1", cn, adOpenKeyset, adLockOptimistic, adCmdTable
Set frmMain.Adodc1.Recordset = rs