JayEff
09-10-2003, 09:09 AM
I have a VB6 program that uses DAO 3.6 for accessing a Access 2002 database which is secured with a MDW file. For that i use the following lines of code:
Dim DB As Database
Dim QD As QueryDef
Dim RS As Recordset
Dim strSQL as String
strSQL = "SELECT tl_id FROM Table Union SELECT tbl_id from Table2;"
'DBEngine.SystemDB = "temp.MDW"
'DBEngine.DefaultUser = "it"
'DBEngine.DefaultPassword = "full"
Set DB = OpenDatabase("C:\Documents and Settings\me\My Documents\temp.mdb", False, False)
Set QD = DB.CreateQueryDef("Numéro_contrat", strSQL)
Set RS = DB.OpenRecordset(dbOpenDynaset)
**************************************
I am getting a "Run-time error '3033'
You do not have the necessary permissions to use the "C:\Documents and Settings\me\My Documents\temp.mdb"
object. Have your system administrator or the person who created this object
establish the appropriate permissions for you."
*************************************************
When I am uncommenting the lines in my code, I am getting this error:
*************************************************
"Run-time error '3028'
Cannot start your application. The workgroup information file is missing or opened exclusively by another user.
*************************************************
The thing is the "it" user is having all the administrator rights on all tables, query, forms...etc. The password is good too. I have tried with the administrator user and the same thing is happening. I have tried a lot of variant but it seems that I am always having security access problems. At some point, I was able to create my QryDef but there was an error on the creation of my Recordset saying the user it was not having the rights on the table of my query. It is not a compacting problem.
Any idea or solution?
Thanks
Dim DB As Database
Dim QD As QueryDef
Dim RS As Recordset
Dim strSQL as String
strSQL = "SELECT tl_id FROM Table Union SELECT tbl_id from Table2;"
'DBEngine.SystemDB = "temp.MDW"
'DBEngine.DefaultUser = "it"
'DBEngine.DefaultPassword = "full"
Set DB = OpenDatabase("C:\Documents and Settings\me\My Documents\temp.mdb", False, False)
Set QD = DB.CreateQueryDef("Numéro_contrat", strSQL)
Set RS = DB.OpenRecordset(dbOpenDynaset)
**************************************
I am getting a "Run-time error '3033'
You do not have the necessary permissions to use the "C:\Documents and Settings\me\My Documents\temp.mdb"
object. Have your system administrator or the person who created this object
establish the appropriate permissions for you."
*************************************************
When I am uncommenting the lines in my code, I am getting this error:
*************************************************
"Run-time error '3028'
Cannot start your application. The workgroup information file is missing or opened exclusively by another user.
*************************************************
The thing is the "it" user is having all the administrator rights on all tables, query, forms...etc. The password is good too. I have tried with the administrator user and the same thing is happening. I have tried a lot of variant but it seems that I am always having security access problems. At some point, I was able to create my QryDef but there was an error on the creation of my Recordset saying the user it was not having the rights on the table of my query. It is not a compacting problem.
Any idea or solution?
Thanks