Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

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

Auto Part Number for SolidWorks 1

Status
Not open for further replies.

appliedocean

Marine/Ocean
Mar 6, 2008
11
OK Gurus I need some help-
I'm trying to get an auto part number generator to work with SW-PRO-2011 on a Win7 64 bit machine. This was originally written by Jeff Cope a few years back and he published it to the web. It uses VB script macro that runs when you launch SW, the macro runs an Access data engine to get the number and uses this number for the part name. I'm getting a "run time error 2147286781 (80030103) can't save" message. I have done a web search and tried a few things including permission settings but I have hit a wall.
Anyone use this interesting app for generating numbers out there?
thanks in advance-
-MB
 
Replies continue below

Recommended for you

There are some real quirks with getting Access to run with VB. This is one of them. I have never figured it out but it is documented somewhere in GoogleLand. I would rewrite it to run with a real SQL database. MSoft has a free SQL Server and MySQL also comes to mind. They are much more robust and don't seem to have these problems.

TOP
CSWP, BSSE
Phenom IIx6 1100T = 8GB = FX1400 = XP64SP2 = SW2009SP3
"Node news is good news."
 
Kellnerp-
thank you for the feedback-
I think you're probably right doing this with sql would be more solid.
I did figure it out after researching all day and trying everything under the sun, what it comes down to are the security and permission settings in Win 7 that make it incredibly hard to turn off the automatic setting of "read only" to files and folders. The autonumber app wants to write back to the access db to update numbers and with a read only setting it breaks down. i have a feeling that this may be OS specific and the solution may change from one system to the other. If anyone stumbles on to this chain and wants to know the solution that worked for me let me know by posting here I'm more than happy to provide that info.
thanks
 
Kellnerp-
I think you are suggesting I make this a FAQ post. I'm not sure how to do that but here is what worked for me plus a possible solution for users that have an earlier OS than Win 7.

Security settings changes to get Autonumber app to work.

For older OS before Win 7:
The Autonumber App is written in VB and uses ActiveX Data Objects (ADO) TO manipulate the data structure in Access. When you try to save an ADO recordset to a file that was created by someone else, you may receive the following error message:
Run-time error '-2147286781 (80030103)':
Can't save.
You receive this error message if the application is in a read-only folder, even if the recordset file is in a folder that has write permissions.
When you try to save the recordset to a file that already exists, the recordset object creates a temporary file in the folder of the application. This folder is a read-only folder. Therefore, the second user cannot overwrite the source file.
This problem is resolved in Microsoft Data Access Components (MDAC) 2.8. In MDAC 2.8, the ADODB recordset creates the temporary file in the same folder as the destination file that was used to save the recordset.

Go to Microsoft Web site: To download Microsoft Data Access Components (MDAC) 2.8,

For the Win 7 OS:
In Win 7 OS the issue is with the security settings and permissions which by default are set to read only. There are a few different ways to attempt to resolve this but I am listing only the one that worked for me.
Browse to the highest level folder that you want to change attributes for:
•RT click folder and select properties
•select security tab
•select advanced (bottom right corner)
•select change permissions
•select add
•enter “everyone” in the box labeled “enter object name to select”
•select check names
•hit “ok”
•select full control in the column labeled “allow”
•hit “ok”
•select the box labeled “replace all child object permissions with inheritable permissions from this object”
•hit “ok”
•Select “yes” to confirm any message windows saying “are you sure” and this will do it.

A fairly involved set up but it works and I’m generating parts with numbers.
 
appliedocean,

How reliable is Access if machines are running different versions?

This could be a very good case against sharing Access data.

Critter.gif
JHG
 
appliedocean,

I wrote a windows batch file that wrote a lock file, then loaded a plain text file into the available editor. I also wrote a UNIX Bash script that locked and loaded the same plain text file, doing text conversions between DOS and UNIX. Our MSDOS, Windows and UNIX machines all could get at the online drawing list.

I could use Microsoft Word due to the aforementioned UNIX machines. Microsoft Window's file locking may be sufficient to make a Word drawing list completely functional.

If your people cannot open a drawing list and take the next number, you have way more serious problems than figuring out Access and VBA scripts.

The KISS rule applies with a vengeance here.

Critter.gif
JHG
 
drawoh said:
If your people cannot open a drawing list and take the next number, you have way more serious problems than figuring out Access and VBA scripts.
I think he is automating this in SW so they don't have to open anything. It just happens. KISS for the user, more difficult for the CAD Admin.

TOP
CSWP, BSSE
Phenom IIx6 1100T = 8GB = FX1400 = XP64SP2 = SW2009SP3
"Node news is good news."
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor