Home All Groups Group Topic Archive Search About

User level security-- do not have necessary permissions

Author
5 Dec 2006 2:35 PM
sheela
Hello,

I have a database, which was working okay to import data from a word
document and also to export data into word document.

I had recently set up user level security on this database (many thanks to
Joan wild for helping on it). After this user level security set up, when I
try to import the data (this is programmed in VB on a command click) from a
word document, I am getting the following message:

-2147467259: you do not have the necessary permissions to use this
‘M:\...\....\ABC.mdb’ object. Have your system or the person who created this
object establish the appropriate permissions for you.

I am the owner/administrator on this DB.

I have also tried with a user name, who is a “Full data User” on this DB,
still getting the same message.

I MS Access 2003 which runs on wondows XP.

The only other change to this DB is change of server. But I could
add/update or delete records in a table in the same database. So I think I
have full permissions on this server.


I would appreciate any help on this issue.


Sheela

Author
5 Dec 2006 3:29 PM
Joan Wild
Are you importing from Word into Access or the other way around?

What is the code you are using?


--
Joan Wild
Microsoft Access MVP

sheela wrote:
Show quoteHide quote
> Hello,
>
> I have a database, which was working okay to import data from a word
> document and also to export data into word document.
>
> I had recently set up user level security on this database (many
> thanks to Joan wild for helping on it). After this user level
> security set up, when I try to import the data (this is programmed in
> VB on a command click) from a word document, I am getting the
> following message:
>
> -2147467259: you do not have the necessary permissions to use this
> 'M:\...\....\ABC.mdb' object. Have your system or the person who
> created this object establish the appropriate permissions for you.
>
> I am the owner/administrator on this DB.
>
> I have also tried with a user name, who is a "Full data User" on this
> DB, still getting the same message.
>
> I MS Access 2003 which runs on wondows XP.
>
> The only other change to this DB is change of server. But I could
> add/update or delete records in a table in the same database. So I
> think I have full permissions on this server.
>
>
> I would appreciate any help on this issue.
>
>
> Sheela
Author
5 Dec 2006 7:07 PM
sheela
Hello Joan,

I am trying import from a word document into MS Access.
The word document is created with bookmarks to read into the DB.
I am using the following code. (I have got this from internet, I do not
remember the owner of the code but it is very helpful code).
This code was working fine, until I have secured the DB. 
I also have similar code to export data from Access DB to word document.
That one is working fine and I am able to export the data from Access DB into
the word document defined bookmarks.
Thank you for your time.
----

Option Compare Database


Sub GetWordData()
Dim appWord As Word.Application
Dim doc As Word.Document
Dim cnn As New ADODB.Connection
Dim rst As New ADODB.Recordset
Dim strDocName As String
Dim blnQuitWord As Boolean

On Error GoTo ErrorHandling

strDocName = "M:\ABC\XYZ\" & _
  InputBox("Enter the name of the Word document " & _
   "you want to import:", "Import Request")
'strDocName = strInputFileName
Set appWord = GetObject(, "Word.Application")
'Set doc = appWord.Documents.Open(strDocName)
Set doc = appWord.Documents.Open(strFolder & strDocName)
cnn.Open "Provider=Microsoft.Jet.OLEDB.4.0;" & _
    "Data Source=M:\ABC\WorkGrpInfoFile\" & _
    "pendingRequests.mdb;"
rst.Open "TblRequests", cnn, _
    adOpenKeyset, adLockOptimistic
' add the data from word forms to the main table
With rst
    .AddNew
    !AniRequestNum = DMax("[AniRequestNum]", "TblRequests") + 1
    !PIFirstName = doc.FormFields("wrdPIFirstname").Result
    !PILastName = doc.FormFields("wrdLastname").Result
    !EmailID = doc.FormFields("wrdPIemail").Result
    !PhoneNumber = doc.FormFields("wrdPhone").Result
    !Title = doc.FormFields("wrdTitle").Result
    ![Date of Request] = doc.FormFields("wrdRequestDate").Result

    .Update
    MsgBox (" first table updated")
    .Close

End With

doc.Close
If blnQuitWord Then appWord.Quit
cnn.Close
MsgBox "Request Imported!"


Cleanup:
Set rst = Nothing
Set cnn = Nothing
Set doc = Nothing
Set appWord = Nothing
Exit Sub
ErrorHandling:
Select Case Err
Case -2147022986, 429
    Set appWord = CreateObject("Word.Application")
    blnQuitWord = True
    Resume Next
Case 5121, 5174
    MsgBox "You must select a valid Word document. " _
        & "No data imported.", vbOKOnly, _
        "Document Not Found"
Case 5941
    MsgBox "The document you selected does not " _
        & "contain the required form fields. " _
        & "No data imported.", vbOKOnly, _
        "Fields Not Found"
Case Else
    MsgBox Err & ": " & Err.Description
End Select
GoTo Cleanup

End Sub





Show quoteHide quote
"Joan Wild" wrote:

> Are you importing from Word into Access or the other way around?
>
> What is the code you are using?
>
>
> --
> Joan Wild
> Microsoft Access MVP
>
> sheela wrote:
> > Hello,
> >
> > I have a database, which was working okay to import data from a word
> > document and also to export data into word document.
> >
> > I had recently set up user level security on this database (many
> > thanks to Joan wild for helping on it). After this user level
> > security set up, when I try to import the data (this is programmed in
> > VB on a command click) from a word document, I am getting the
> > following message:
> >
> > -2147467259: you do not have the necessary permissions to use this
> > 'M:\...\....\ABC.mdb' object. Have your system or the person who
> > created this object establish the appropriate permissions for you.
> >
> > I am the owner/administrator on this DB.
> >
> > I have also tried with a user name, who is a "Full data User" on this
> > DB, still getting the same message.
> >
> > I MS Access 2003 which runs on wondows XP.
> >
> > The only other change to this DB is change of server. But I could
> > add/update or delete records in a table in the same database. So I
> > think I have full permissions on this server.
> >
> >
> > I would appreciate any help on this issue.
> >
> >
> > Sheela
>
>
>
Author
5 Dec 2006 7:24 PM
sheela
sorry, I gorgot to add... to my previuos email.

This module is called from a command button click.

thanks.

Show quoteHide quote
"sheela" wrote:

> Hello Joan,
>
> I am trying import from a word document into MS Access.
> The word document is created with bookmarks to read into the DB.
> I am using the following code. (I have got this from internet, I do not
> remember the owner of the code but it is very helpful code).
> This code was working fine, until I have secured the DB. 
> I also have similar code to export data from Access DB to word document.
> That one is working fine and I am able to export the data from Access DB into
> the word document defined bookmarks.
> Thank you for your time.
> ----
>
> Option Compare Database
>
>
> Sub GetWordData()
> Dim appWord As Word.Application
> Dim doc As Word.Document
> Dim cnn As New ADODB.Connection
> Dim rst As New ADODB.Recordset
> Dim strDocName As String
> Dim blnQuitWord As Boolean
>
> On Error GoTo ErrorHandling
>
> strDocName = "M:\ABC\XYZ\" & _
>   InputBox("Enter the name of the Word document " & _
>    "you want to import:", "Import Request")
> 'strDocName = strInputFileName
> Set appWord = GetObject(, "Word.Application")
> 'Set doc = appWord.Documents.Open(strDocName)
> Set doc = appWord.Documents.Open(strFolder & strDocName)
> cnn.Open "Provider=Microsoft.Jet.OLEDB.4.0;" & _
>     "Data Source=M:\ABC\WorkGrpInfoFile\" & _
>     "pendingRequests.mdb;"
> rst.Open "TblRequests", cnn, _
>     adOpenKeyset, adLockOptimistic
> ' add the data from word forms to the main table
> With rst
>     .AddNew
>     !AniRequestNum = DMax("[AniRequestNum]", "TblRequests") + 1
>     !PIFirstName = doc.FormFields("wrdPIFirstname").Result
>     !PILastName = doc.FormFields("wrdLastname").Result
>     !EmailID = doc.FormFields("wrdPIemail").Result
>     !PhoneNumber = doc.FormFields("wrdPhone").Result
>     !Title = doc.FormFields("wrdTitle").Result
>     ![Date of Request] = doc.FormFields("wrdRequestDate").Result
>     
>     .Update
>     MsgBox (" first table updated")
>     .Close
>    
> End With
>
> doc.Close
> If blnQuitWord Then appWord.Quit
> cnn.Close
> MsgBox "Request Imported!"
>
>
> Cleanup:
> Set rst = Nothing
> Set cnn = Nothing
> Set doc = Nothing
> Set appWord = Nothing
> Exit Sub
> ErrorHandling:
> Select Case Err
> Case -2147022986, 429
>     Set appWord = CreateObject("Word.Application")
>     blnQuitWord = True
>     Resume Next
> Case 5121, 5174
>     MsgBox "You must select a valid Word document. " _
>         & "No data imported.", vbOKOnly, _
>         "Document Not Found"
> Case 5941
>     MsgBox "The document you selected does not " _
>         & "contain the required form fields. " _
>         & "No data imported.", vbOKOnly, _
>         "Fields Not Found"
> Case Else
>     MsgBox Err & ": " & Err.Description
> End Select
> GoTo Cleanup
>
> End Sub
>
>
>
>
>
> "Joan Wild" wrote:
>
> > Are you importing from Word into Access or the other way around?
> >
> > What is the code you are using?
> >
> >
> > --
> > Joan Wild
> > Microsoft Access MVP
> >
> > sheela wrote:
> > > Hello,
> > >
> > > I have a database, which was working okay to import data from a word
> > > document and also to export data into word document.
> > >
> > > I had recently set up user level security on this database (many
> > > thanks to Joan wild for helping on it). After this user level
> > > security set up, when I try to import the data (this is programmed in
> > > VB on a command click) from a word document, I am getting the
> > > following message:
> > >
> > > -2147467259: you do not have the necessary permissions to use this
> > > 'M:\...\....\ABC.mdb' object. Have your system or the person who
> > > created this object establish the appropriate permissions for you.
> > >
> > > I am the owner/administrator on this DB.
> > >
> > > I have also tried with a user name, who is a "Full data User" on this
> > > DB, still getting the same message.
> > >
> > > I MS Access 2003 which runs on wondows XP.
> > >
> > > The only other change to this DB is change of server. But I could
> > > add/update or delete records in a table in the same database. So I
> > > think I have full permissions on this server.
> > >
> > >
> > > I would appreciate any help on this issue.
> > >
> > >
> > > Sheela
> >
> >
> >
Author
5 Dec 2006 8:06 PM
Joan Wild
I don't use ADO however I believe you need to supply the mdw and
username/password

cnn.Open "Provider=Microsoft.Jet.OLEDB.4.0;" & _
   "Data Source=M:\ABC\WorkGrpInfoFile\" & _
   "pendingRequests.mdb;" & _
    "Jet OLEDB:System Database=Secure.mdw", _
    "Username", "Password"


--
Joan Wild
Microsoft Access MVP
sheela wrote:
Show quoteHide quote
> Hello Joan,
>
> I am trying import from a word document into MS Access.
> The word document is created with bookmarks to read into the DB.
> I am using the following code. (I have got this from internet, I do
> not remember the owner of the code but it is very helpful code).
> This code was working fine, until I have secured the DB.
> I also have similar code to export data from Access DB to word
> document. That one is working fine and I am able to export the data
> from Access DB into the word document defined bookmarks.
> Thank you for your time.
> ----
>
> Option Compare Database
>
>
> Sub GetWordData()
> Dim appWord As Word.Application
> Dim doc As Word.Document
> Dim cnn As New ADODB.Connection
> Dim rst As New ADODB.Recordset
> Dim strDocName As String
> Dim blnQuitWord As Boolean
>
> On Error GoTo ErrorHandling
>
> strDocName = "M:\ABC\XYZ\" & _
>  InputBox("Enter the name of the Word document " & _
>   "you want to import:", "Import Request")
> 'strDocName = strInputFileName
> Set appWord = GetObject(, "Word.Application")
> 'Set doc = appWord.Documents.Open(strDocName)
> Set doc = appWord.Documents.Open(strFolder & strDocName)
> cnn.Open "Provider=Microsoft.Jet.OLEDB.4.0;" & _
>    "Data Source=M:\ABC\WorkGrpInfoFile\" & _
>    "pendingRequests.mdb;"
> rst.Open "TblRequests", cnn, _
>    adOpenKeyset, adLockOptimistic
> ' add the data from word forms to the main table
> With rst
>    .AddNew
>    !AniRequestNum = DMax("[AniRequestNum]", "TblRequests") + 1
>    !PIFirstName = doc.FormFields("wrdPIFirstname").Result
>    !PILastName = doc.FormFields("wrdLastname").Result
>    !EmailID = doc.FormFields("wrdPIemail").Result
>    !PhoneNumber = doc.FormFields("wrdPhone").Result
>    !Title = doc.FormFields("wrdTitle").Result
>    ![Date of Request] = doc.FormFields("wrdRequestDate").Result
>
>    .Update
>    MsgBox (" first table updated")
>    .Close
>
> End With
>
> doc.Close
> If blnQuitWord Then appWord.Quit
> cnn.Close
> MsgBox "Request Imported!"
>
>
> Cleanup:
> Set rst = Nothing
> Set cnn = Nothing
> Set doc = Nothing
> Set appWord = Nothing
> Exit Sub
> ErrorHandling:
> Select Case Err
> Case -2147022986, 429
>    Set appWord = CreateObject("Word.Application")
>    blnQuitWord = True
>    Resume Next
> Case 5121, 5174
>    MsgBox "You must select a valid Word document. " _
>        & "No data imported.", vbOKOnly, _
>        "Document Not Found"
> Case 5941
>    MsgBox "The document you selected does not " _
>        & "contain the required form fields. " _
>        & "No data imported.", vbOKOnly, _
>        "Fields Not Found"
> Case Else
>    MsgBox Err & ": " & Err.Description
> End Select
> GoTo Cleanup
>
> End Sub
>
>
>
>
>
> "Joan Wild" wrote:
>
>> Are you importing from Word into Access or the other way around?
>>
>> What is the code you are using?
>>
>>
>> --
>> Joan Wild
>> Microsoft Access MVP
>>
>> sheela wrote:
>>> Hello,
>>>
>>> I have a database, which was working okay to import data from a word
>>> document and also to export data into word document.
>>>
>>> I had recently set up user level security on this database (many
>>> thanks to Joan wild for helping on it). After this user level
>>> security set up, when I try to import the data (this is programmed
>>> in VB on a command click) from a word document, I am getting the
>>> following message:
>>>
>>> -2147467259: you do not have the necessary permissions to use this
>>> 'M:\...\....\ABC.mdb' object. Have your system or the person who
>>> created this object establish the appropriate permissions for you.
>>>
>>> I am the owner/administrator on this DB.
>>>
>>> I have also tried with a user name, who is a "Full data User" on
>>> this DB, still getting the same message.
>>>
>>> I MS Access 2003 which runs on wondows XP.
>>>
>>> The only other change to this DB is change of server. But I could
>>> add/update or delete records in a table in the same database. So I
>>> think I have full permissions on this server.
>>>
>>>
>>> I would appreciate any help on this issue.
>>>
>>>
>>> Sheela
Author
5 Dec 2006 8:29 PM
sheela
Hell Joan,

Thank you very much for your prompt reply. I have changed the code as your
suggestion. Now I am getting the following error.


" -2147217843: Cannot start your apllication. The workgroup information file
is missing or opened exclusively by another user. "

Since the database is open that work group info file is also open.

Is there a work around for this?
I really apreaciate your help on this.

Sheela


Show quoteHide quote
"Joan Wild" wrote:

> I don't use ADO however I believe you need to supply the mdw and
> username/password
>
> cnn.Open "Provider=Microsoft.Jet.OLEDB.4.0;" & _
>    "Data Source=M:\ABC\WorkGrpInfoFile\" & _
>    "pendingRequests.mdb;" & _
>     "Jet OLEDB:System Database=Secure.mdw", _
>     "Username", "Password"
>
>
> --
> Joan Wild
> Microsoft Access MVP
> sheela wrote:
> > Hello Joan,
> >
> > I am trying import from a word document into MS Access.
> > The word document is created with bookmarks to read into the DB.
> > I am using the following code. (I have got this from internet, I do
> > not remember the owner of the code but it is very helpful code).
> > This code was working fine, until I have secured the DB.
> > I also have similar code to export data from Access DB to word
> > document. That one is working fine and I am able to export the data
> > from Access DB into the word document defined bookmarks.
> > Thank you for your time.
> > ----
> >
> > Option Compare Database
> >
> >
> > Sub GetWordData()
> > Dim appWord As Word.Application
> > Dim doc As Word.Document
> > Dim cnn As New ADODB.Connection
> > Dim rst As New ADODB.Recordset
> > Dim strDocName As String
> > Dim blnQuitWord As Boolean
> >
> > On Error GoTo ErrorHandling
> >
> > strDocName = "M:\ABC\XYZ\" & _
> >  InputBox("Enter the name of the Word document " & _
> >   "you want to import:", "Import Request")
> > 'strDocName = strInputFileName
> > Set appWord = GetObject(, "Word.Application")
> > 'Set doc = appWord.Documents.Open(strDocName)
> > Set doc = appWord.Documents.Open(strFolder & strDocName)
> > cnn.Open "Provider=Microsoft.Jet.OLEDB.4.0;" & _
> >    "Data Source=M:\ABC\WorkGrpInfoFile\" & _
> >    "pendingRequests.mdb;"
> > rst.Open "TblRequests", cnn, _
> >    adOpenKeyset, adLockOptimistic
> > ' add the data from word forms to the main table
> > With rst
> >    .AddNew
> >    !AniRequestNum = DMax("[AniRequestNum]", "TblRequests") + 1
> >    !PIFirstName = doc.FormFields("wrdPIFirstname").Result
> >    !PILastName = doc.FormFields("wrdLastname").Result
> >    !EmailID = doc.FormFields("wrdPIemail").Result
> >    !PhoneNumber = doc.FormFields("wrdPhone").Result
> >    !Title = doc.FormFields("wrdTitle").Result
> >    ![Date of Request] = doc.FormFields("wrdRequestDate").Result
> >
> >    .Update
> >    MsgBox (" first table updated")
> >    .Close
> >
> > End With
> >
> > doc.Close
> > If blnQuitWord Then appWord.Quit
> > cnn.Close
> > MsgBox "Request Imported!"
> >
> >
> > Cleanup:
> > Set rst = Nothing
> > Set cnn = Nothing
> > Set doc = Nothing
> > Set appWord = Nothing
> > Exit Sub
> > ErrorHandling:
> > Select Case Err
> > Case -2147022986, 429
> >    Set appWord = CreateObject("Word.Application")
> >    blnQuitWord = True
> >    Resume Next
> > Case 5121, 5174
> >    MsgBox "You must select a valid Word document. " _
> >        & "No data imported.", vbOKOnly, _
> >        "Document Not Found"
> > Case 5941
> >    MsgBox "The document you selected does not " _
> >        & "contain the required form fields. " _
> >        & "No data imported.", vbOKOnly, _
> >        "Fields Not Found"
> > Case Else
> >    MsgBox Err & ": " & Err.Description
> > End Select
> > GoTo Cleanup
> >
> > End Sub
> >
> >
> >
> >
> >
> > "Joan Wild" wrote:
> >
> >> Are you importing from Word into Access or the other way around?
> >>
> >> What is the code you are using?
> >>
> >>
> >> --
> >> Joan Wild
> >> Microsoft Access MVP
> >>
> >> sheela wrote:
> >>> Hello,
> >>>
> >>> I have a database, which was working okay to import data from a word
> >>> document and also to export data into word document.
> >>>
> >>> I had recently set up user level security on this database (many
> >>> thanks to Joan wild for helping on it). After this user level
> >>> security set up, when I try to import the data (this is programmed
> >>> in VB on a command click) from a word document, I am getting the
> >>> following message:
> >>>
> >>> -2147467259: you do not have the necessary permissions to use this
> >>> 'M:\...\....\ABC.mdb' object. Have your system or the person who
> >>> created this object establish the appropriate permissions for you.
> >>>
> >>> I am the owner/administrator on this DB.
> >>>
> >>> I have also tried with a user name, who is a "Full data User" on
> >>> this DB, still getting the same message.
> >>>
> >>> I MS Access 2003 which runs on wondows XP.
> >>>
> >>> The only other change to this DB is change of server. But I could
> >>> add/update or delete records in a table in the same database. So I
> >>> think I have full permissions on this server.
> >>>
> >>>
> >>> I would appreciate any help on this issue.
> >>>
> >>>
> >>> Sheela
>
>
>
Author
5 Dec 2006 8:34 PM
Joan Wild
The workgroup file would only be opened exclusively if:
1. The windows user doesn't have create permissions on the folder.  The mdw,
like the mdb, need to create an associated ldb file in the folder.  If the
user doesn't have create permission, then the mdw gets opened exclusively.
All users need create permission.
2. The mdw and the mdb are in the same folder and have the same name - the
*each* need to create a ldb and can't if they are named the same.

--
Joan Wild
Microsoft Access MVP

sheela wrote:
Show quoteHide quote
> Hell Joan,
>
> Thank you very much for your prompt reply. I have changed the code as
> your suggestion. Now I am getting the following error.
>
>
> " -2147217843: Cannot start your apllication. The workgroup
> information file is missing or opened exclusively by another user. "
>
> Since the database is open that work group info file is also open.
>
> Is there a work around for this?
> I really apreaciate your help on this.
>
> Sheela
>
>
> "Joan Wild" wrote:
>
>> I don't use ADO however I believe you need to supply the mdw and
>> username/password
>>
>> cnn.Open "Provider=Microsoft.Jet.OLEDB.4.0;" & _
>>    "Data Source=M:\ABC\WorkGrpInfoFile\" & _
>>    "pendingRequests.mdb;" & _
>>     "Jet OLEDB:System Database=Secure.mdw", _
>>     "Username", "Password"
>>
>>
>> --
>> Joan Wild
>> Microsoft Access MVP
>> sheela wrote:
>>> Hello Joan,
>>>
>>> I am trying import from a word document into MS Access.
>>> The word document is created with bookmarks to read into the DB.
>>> I am using the following code. (I have got this from internet, I do
>>> not remember the owner of the code but it is very helpful code).
>>> This code was working fine, until I have secured the DB.
>>> I also have similar code to export data from Access DB to word
>>> document. That one is working fine and I am able to export the data
>>> from Access DB into the word document defined bookmarks.
>>> Thank you for your time.
>>> ----
>>>
>>> Option Compare Database
>>>
>>>
>>> Sub GetWordData()
>>> Dim appWord As Word.Application
>>> Dim doc As Word.Document
>>> Dim cnn As New ADODB.Connection
>>> Dim rst As New ADODB.Recordset
>>> Dim strDocName As String
>>> Dim blnQuitWord As Boolean
>>>
>>> On Error GoTo ErrorHandling
>>>
>>> strDocName = "M:\ABC\XYZ\" & _
>>>  InputBox("Enter the name of the Word document " & _
>>>   "you want to import:", "Import Request")
>>> 'strDocName = strInputFileName
>>> Set appWord = GetObject(, "Word.Application")
>>> 'Set doc = appWord.Documents.Open(strDocName)
>>> Set doc = appWord.Documents.Open(strFolder & strDocName)
>>> cnn.Open "Provider=Microsoft.Jet.OLEDB.4.0;" & _
>>>    "Data Source=M:\ABC\WorkGrpInfoFile\" & _
>>>    "pendingRequests.mdb;"
>>> rst.Open "TblRequests", cnn, _
>>>    adOpenKeyset, adLockOptimistic
>>> ' add the data from word forms to the main table
>>> With rst
>>>    .AddNew
>>>    !AniRequestNum = DMax("[AniRequestNum]", "TblRequests") + 1
>>>    !PIFirstName = doc.FormFields("wrdPIFirstname").Result
>>>    !PILastName = doc.FormFields("wrdLastname").Result
>>>    !EmailID = doc.FormFields("wrdPIemail").Result
>>>    !PhoneNumber = doc.FormFields("wrdPhone").Result
>>>    !Title = doc.FormFields("wrdTitle").Result
>>>    ![Date of Request] = doc.FormFields("wrdRequestDate").Result
>>>
>>>    .Update
>>>    MsgBox (" first table updated")
>>>    .Close
>>>
>>> End With
>>>
>>> doc.Close
>>> If blnQuitWord Then appWord.Quit
>>> cnn.Close
>>> MsgBox "Request Imported!"
>>>
>>>
>>> Cleanup:
>>> Set rst = Nothing
>>> Set cnn = Nothing
>>> Set doc = Nothing
>>> Set appWord = Nothing
>>> Exit Sub
>>> ErrorHandling:
>>> Select Case Err
>>> Case -2147022986, 429
>>>    Set appWord = CreateObject("Word.Application")
>>>    blnQuitWord = True
>>>    Resume Next
>>> Case 5121, 5174
>>>    MsgBox "You must select a valid Word document. " _
>>>        & "No data imported.", vbOKOnly, _
>>>        "Document Not Found"
>>> Case 5941
>>>    MsgBox "The document you selected does not " _
>>>        & "contain the required form fields. " _
>>>        & "No data imported.", vbOKOnly, _
>>>        "Fields Not Found"
>>> Case Else
>>>    MsgBox Err & ": " & Err.Description
>>> End Select
>>> GoTo Cleanup
>>>
>>> End Sub
>>>
>>>
>>>
>>>
>>>
>>> "Joan Wild" wrote:
>>>
>>>> Are you importing from Word into Access or the other way around?
>>>>
>>>> What is the code you are using?
>>>>
>>>>
>>>> --
>>>> Joan Wild
>>>> Microsoft Access MVP
>>>>
>>>> sheela wrote:
>>>>> Hello,
>>>>>
>>>>> I have a database, which was working okay to import data from a
>>>>> word document and also to export data into word document.
>>>>>
>>>>> I had recently set up user level security on this database (many
>>>>> thanks to Joan wild for helping on it). After this user level
>>>>> security set up, when I try to import the data (this is programmed
>>>>> in VB on a command click) from a word document, I am getting the
>>>>> following message:
>>>>>
>>>>> -2147467259: you do not have the necessary permissions to use this
>>>>> 'M:\...\....\ABC.mdb' object. Have your system or the person who
>>>>> created this object establish the appropriate permissions for you.
>>>>>
>>>>> I am the owner/administrator on this DB.
>>>>>
>>>>> I have also tried with a user name, who is a "Full data User" on
>>>>> this DB, still getting the same message.
>>>>>
>>>>> I MS Access 2003 which runs on wondows XP.
>>>>>
>>>>> The only other change to this DB is change of server. But I could
>>>>> add/update or delete records in a table in the same database. So I
>>>>> think I have full permissions on this server.
>>>>>
>>>>>
>>>>> I would appreciate any help on this issue.
>>>>>
>>>>>
>>>>> Sheela
Author
5 Dec 2006 8:49 PM
sheela
Joan,

It is working, My work group info file is with a different name. Once I gave
the correct path and name of work group info file ,  I am getting different
warning. I guess this warning is something to do with my table structure.

Thank you so.... much for your prompt help.
Sheela.

Show quoteHide quote
"sheela" wrote:

> Hell Joan,
>
> Thank you very much for your prompt reply. I have changed the code as your
> suggestion. Now I am getting the following error.
>
>
> " -2147217843: Cannot start your apllication. The workgroup information file
> is missing or opened exclusively by another user. "
>
> Since the database is open that work group info file is also open.
>
> Is there a work around for this?
> I really apreaciate your help on this.
>
> Sheela
>
>
> "Joan Wild" wrote:
>
> > I don't use ADO however I believe you need to supply the mdw and
> > username/password
> >
> > cnn.Open "Provider=Microsoft.Jet.OLEDB.4.0;" & _
> >    "Data Source=M:\ABC\WorkGrpInfoFile\" & _
> >    "pendingRequests.mdb;" & _
> >     "Jet OLEDB:System Database=Secure.mdw", _
> >     "Username", "Password"
> >
> >
> > --
> > Joan Wild
> > Microsoft Access MVP
> > sheela wrote:
> > > Hello Joan,
> > >
> > > I am trying import from a word document into MS Access.
> > > The word document is created with bookmarks to read into the DB.
> > > I am using the following code. (I have got this from internet, I do
> > > not remember the owner of the code but it is very helpful code).
> > > This code was working fine, until I have secured the DB.
> > > I also have similar code to export data from Access DB to word
> > > document. That one is working fine and I am able to export the data
> > > from Access DB into the word document defined bookmarks.
> > > Thank you for your time.
> > > ----
> > >
> > > Option Compare Database
> > >
> > >
> > > Sub GetWordData()
> > > Dim appWord As Word.Application
> > > Dim doc As Word.Document
> > > Dim cnn As New ADODB.Connection
> > > Dim rst As New ADODB.Recordset
> > > Dim strDocName As String
> > > Dim blnQuitWord As Boolean
> > >
> > > On Error GoTo ErrorHandling
> > >
> > > strDocName = "M:\ABC\XYZ\" & _
> > >  InputBox("Enter the name of the Word document " & _
> > >   "you want to import:", "Import Request")
> > > 'strDocName = strInputFileName
> > > Set appWord = GetObject(, "Word.Application")
> > > 'Set doc = appWord.Documents.Open(strDocName)
> > > Set doc = appWord.Documents.Open(strFolder & strDocName)
> > > cnn.Open "Provider=Microsoft.Jet.OLEDB.4.0;" & _
> > >    "Data Source=M:\ABC\WorkGrpInfoFile\" & _
> > >    "pendingRequests.mdb;"
> > > rst.Open "TblRequests", cnn, _
> > >    adOpenKeyset, adLockOptimistic
> > > ' add the data from word forms to the main table
> > > With rst
> > >    .AddNew
> > >    !AniRequestNum = DMax("[AniRequestNum]", "TblRequests") + 1
> > >    !PIFirstName = doc.FormFields("wrdPIFirstname").Result
> > >    !PILastName = doc.FormFields("wrdLastname").Result
> > >    !EmailID = doc.FormFields("wrdPIemail").Result
> > >    !PhoneNumber = doc.FormFields("wrdPhone").Result
> > >    !Title = doc.FormFields("wrdTitle").Result
> > >    ![Date of Request] = doc.FormFields("wrdRequestDate").Result
> > >
> > >    .Update
> > >    MsgBox (" first table updated")
> > >    .Close
> > >
> > > End With
> > >
> > > doc.Close
> > > If blnQuitWord Then appWord.Quit
> > > cnn.Close
> > > MsgBox "Request Imported!"
> > >
> > >
> > > Cleanup:
> > > Set rst = Nothing
> > > Set cnn = Nothing
> > > Set doc = Nothing
> > > Set appWord = Nothing
> > > Exit Sub
> > > ErrorHandling:
> > > Select Case Err
> > > Case -2147022986, 429
> > >    Set appWord = CreateObject("Word.Application")
> > >    blnQuitWord = True
> > >    Resume Next
> > > Case 5121, 5174
> > >    MsgBox "You must select a valid Word document. " _
> > >        & "No data imported.", vbOKOnly, _
> > >        "Document Not Found"
> > > Case 5941
> > >    MsgBox "The document you selected does not " _
> > >        & "contain the required form fields. " _
> > >        & "No data imported.", vbOKOnly, _
> > >        "Fields Not Found"
> > > Case Else
> > >    MsgBox Err & ": " & Err.Description
> > > End Select
> > > GoTo Cleanup
> > >
> > > End Sub
> > >
> > >
> > >
> > >
> > >
> > > "Joan Wild" wrote:
> > >
> > >> Are you importing from Word into Access or the other way around?
> > >>
> > >> What is the code you are using?
> > >>
> > >>
> > >> --
> > >> Joan Wild
> > >> Microsoft Access MVP
> > >>
> > >> sheela wrote:
> > >>> Hello,
> > >>>
> > >>> I have a database, which was working okay to import data from a word
> > >>> document and also to export data into word document.
> > >>>
> > >>> I had recently set up user level security on this database (many
> > >>> thanks to Joan wild for helping on it). After this user level
> > >>> security set up, when I try to import the data (this is programmed
> > >>> in VB on a command click) from a word document, I am getting the
> > >>> following message:
> > >>>
> > >>> -2147467259: you do not have the necessary permissions to use this
> > >>> 'M:\...\....\ABC.mdb' object. Have your system or the person who
> > >>> created this object establish the appropriate permissions for you.
> > >>>
> > >>> I am the owner/administrator on this DB.
> > >>>
> > >>> I have also tried with a user name, who is a "Full data User" on
> > >>> this DB, still getting the same message.
> > >>>
> > >>> I MS Access 2003 which runs on wondows XP.
> > >>>
> > >>> The only other change to this DB is change of server. But I could
> > >>> add/update or delete records in a table in the same database. So I
> > >>> think I have full permissions on this server.
> > >>>
> > >>>
> > >>> I would appreciate any help on this issue.
> > >>>
> > >>>
> > >>> Sheela
> >
> >
> >