Problems with an access workgroup?

O

Oldie

I designed my form based on an Access database table and I can query the
data. However, when I try to submit data I am told I don't have permission. I
guess that this is because the Access database is secured by means of a
workgroup.

1. I am suprised that Infopath can read (and query) the data. Are there any
security issues here i shuld know about?

2. How do I specify a workgroup (or user login) so I can submit the
information? Does this have something to do with "trusted source" or am I on
the wrong track?

The other possibility is that I am reading from an Access 2003 frontend
which links to data in an Access 97 database. So effectively I am trying to
write data to Access 97. I don't have control over this as some users still
use an Access 97.mde frontend - which could be why I am trying to get
Infopath to work in the first place! LOL

Any help appreciated!
 
S

Scott L. Heim [MSFT]

Hi,

When you create your connection to the Access database, you will need to
modify some of the properties so that you can specify the Workgroup
Information File.

See if these steps help (and these are starting fresh to create a new
connection and test form.)

- Create a new InfoPath solution and choose From Data Connection
- Select Database and click Next
- Click the Select Database button
- Click the New Source button
- Select Other/Advanced and click Next
- Select the "Microsoft Jet 4.0 OLE DB Provider" option and click the "Next- Click the builder button (...) next to Select or enter database name and
locate your database
- Click the "All" tab
- Select the: Jet OLEDB:System database entry and click the Edit Value
button
- Enter the path to your MDW (Workgroup Information File) and include the
actual file name (i.e. C:\MyWorkgroupFile.MDW)
- If you want to store the User ID and Password, you can modify those
options as well
- Click OK

You should be able to now build a test form from this database and
successfully submit to it as well!

I hope this helps!

Scott L. Heim
Microsoft Developer Support

This posting is provided "AS IS" with no warranties, and confers no rights.
 
O

Oldie

Thanks Scott - I don't think I would have got there on my own!

I couldn't find any references to this in any of the Infopath
texts I have read. I actually used your info to reset an existing database
path to use a workgroup. I was getting very frustrated that I had "read" but
not "write" access.

Took less than a minute to get this fixed. Brilliant!

Still new to Infopath but I can see its potential! Fantastic!

Regards, Oldie (Getting even older this week!)
 
S

Scott L. Heim [MSFT]

Hi,

Thank you for the update - I am glad that information helped! :)

Technically, this is not specifically an "InfoPath" issue, which is why you
probably did not see this in any InfoPath books.

When you create an OLEDB connection to Access from most any application,
the same dialog is used and in order to specify the workgroup, user, etc.
various "Extended Properties" need to be specified in the connection string
for OLEDB hence the "All" tab on this dialog to allow modification of these
properties.

Best Regards,

Scott L. Heim
Microsoft Developer Support

This posting is provided "AS IS" with no warranties, and confers no rights.
 
S

Scott L. Heim [MSFT]

Hi,

By chance, would the "user id's" be the same as the user's network logon?
If not, would you be able to have the user's enter their Access "user id"
in a field on the form?

There are only a couple of options for making this work:

- After you initially setup the connection information, modify the
Manifest.xsf file to remove the user id information and then when the user
sees the prompt, they would need to cancel that initial box and would then
get a prompt allowing them to enter user and password information.
- Using code, you could modify the connection string for your data
connection so that when the user executed the query, the code would
automatically either pickup their logon name or get it from a field on the
form so that they would only need to enter the password in the prompt that
appears.

Here is a VBScript example of this option - this would be used on the click
event of a button:

Dim strConn
Dim strFind

strConn = XDocument.DataAdapters(0).connection
strFind = "User ID="""""
strConn = replace(strConn, strFind, "User ID = 'scott'")

XDocument.DataAdapters(0).connection = strConn
XDocument.Query

Let me know if you need any additional information on this!

Best Regards,

Scott L. Heim
Microsoft Developer Support

This posting is provided "AS IS" with no warranties, and confers no rights.
 
S

Scott L. Heim [MSFT]

Hi Smaur,

I believe the issue you are seeing is because the sample code I provided
was VBScript whereas you are using JScript.

Here is a modified sample using JScript:

function CTRL2_8::OnClick(eventObj)
{
var strConn;
var oNetwork = new ActiveXObject("WScript.Network");
var strUserName = oNetwork.UserName;

strConn = XDocument.DataAdapters(0).Connection;
strConn = strConn.replace(/MyAdmin/, "Test");

XDocument.DataAdapters(0).Connection = strConn;
XDocument.Query();
}

You will notice the "replace" method is called differently and the letter
"C" in "Connection" needs to be capitalized.

Let me know how this works! :)

Scott L. Heim
Microsoft Developer Support

This posting is provided "AS IS" with no warranties, and confers no rights.
 
S

Scott L. Heim [MSFT]

Hi Smaur,

That's great to hear - thank you for the update!

Best Regards,

Scott L. Heim
Microsoft Developer Support

This posting is provided "AS IS" with no warranties, and confers no rights.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top