Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

DAO & ADO Run-time error 3028

Status
Not open for further replies.

NW

Programmer
Feb 3, 2000
61
0
0
GB
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
 
Dear NW,

where exactly does the error occur, try going through step by step. (using F8)

I suppose it occurs when you try to open the adodb.connection.

Createdatabase gives back an open database object, could be by default opened exclusivly. So when you try to open another connection to the same object, your error could appear.

perhaps you have to close your db just after creating it.
sysdb.close



HTH

regards Astrid
 
Dear Sawatzky,
You were right. Error occurs when try to open the connection. I also tried with closing DBF with negative results. I can use the same coding without a User ID & a password with no errors. Do I have the correct syntax? or will it looking at a workgroup file only when there's a usid & pwd? How I can I use the workgroup file in shared more?
Thanks for your time.
 
Dear NW,

I am not sure what the option 'persist security info' is for, but I would try to leave this option out.

I am not sure about workgroup, so I am just guessing.

HTH

regards Astrid
 
I don't know whether I'm reading this wrong but are you trying to create the database with the password "pwd" and then trying to create a connection to it with the password "MMG" ?
 
DLLS required for Buiding an VB application so that it can be deployed in remote machine.

we are getting ADO error if go by default setting.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top