MZ Tools: Where Does It Store User's Data?

P

PeteCresswell

Just discovered this little gem.

Is there any hope of my transporting it's data between various PCs
that I work with?

e.g. If I build a set of templates, do I have to do it anew each time
I move to another box?
 
A

Arvin Meyer [MVP]

There's an ini file in the MZ Tools folder located in the default spot which
is probably:

C:\Program Files\MZTools3VBA\MZTools3VBA.ini

unless you have changed the location. After installing the exe to each
computer, replace that ini file with your saved one.
 
B

boblarson

Yes, there is an INI file that stores the stuff, but it is located in

C:\Documents and Settings\YourUserNameHere\Application Data\MZTools
Software\MZTools3

--

Bob Larson
Access MVP
Access World Forums Administrator
Utter Access VIP
Free Access Resources at http://www.btabdevelopment.com
 
P

PeteCresswell

Yes, there is an INI file that stores the stuff, but it is located in

C:\Documents and Settings\YourUserNameHere\Application Data\MZTools
Software\MZTools3


Gotta love it!!!!....

I had fears of somebody using the registry.

Thanks.
 
A

Arvin Meyer [MVP]

boblarson said:
Yes, there is an INI file that stores the stuff, but it is located in

C:\Documents and Settings\YourUserNameHere\Application Data\MZTools
Software\MZTools3

Probably because you put it there. <g> I just installed it on a brand new
machine yesterday. The default location was as I mentioned. Perhaps there's
a new install routine. Downloaded the version for everything but VBA 2007 in
July of 2006. As far as I know though, it's still version 3 and nothing has
changed.
 
A

Arvin Meyer [MVP]

Nothing to fear. It is relatively easy to both read from and write to the
registry, if you have permissions. Here's some code to read a value:

QueryRegistryKeyValue

Private Declare Function RegOpenKeyEx Lib "advapi32.dll" _
Alias "RegOpenKeyExA" (ByVal hKey As Long, _
ByVal lpSubKey As String, ByVal ulOptions As Long, _
ByVal samDesired As Long, ByRef phkResult As Long) _
As Long

' the values for lPredefinedKey

Public Const HKEY_CLASSES_ROOT = &H80000000
Public Const HKEY_CURRENT_USER = &H80000001
Public Const HKEY_LOCAL_MACHINE = &H80000002
Public Const HKEY_USERS = &H80000003
Public Const HKEY_PERFORMANCE_DATA = &H80000004
Public Const HKEY_CURRENT_CONFIG = &H80000005
Public Const HKEY_DYN_DATA = &H80000006

Public Function QueryRegistryKeyValue(sKeyName As String, sValueName As
String, _
lPredefinedKey As Long) 'QueryValue "TestKey\SubKey1", "StringValue"
,HKEY_CURRENT_USER

Dim lRetVal As Long 'result of the API functions
Dim hKey As Long 'handle of opened key
Dim vValue As Variant 'setting of queried value

lRetVal = RegOpenKeyEx(lPredefinedKey, sKeyName, 0, _
KEY_READ, hKey)
lRetVal = QueryValueEx(hKey, sValueName, vValue)
QueryRegistryKeyValue = vValue
RegCloseKey (hKey)
End Function

I think Albert Kallal wrote some code to change printers that involved
reading and writing to the registry. You might hunt it down on his website.
See:

http://bytes.com/forum/thread492661.html
 
P

(PeteCresswell)

Per Arvin Meyer [MVP]:
Nothing to fear. It is relatively easy to both read from and write to the
registry, if you have permissions. Here's some code to read a value:

Been there.... but it's a *lot* easier to just copy a .INI
file.... It's probably just me, but I think the registry is way
over-used.
 
P

(PeteCresswell)

Per boblarson:
I installed to the default location when I installed.

Same here - and I got the user dir location too.

The-Good-Right-And-Holy-Path AFIK. In fact, last year I spent
quite a few man hours converting my deployment strategy from
using C:\Temp to C:\Documents and Settings\[username]...
 
T

Tony Toews [MVP]

Arvin Meyer said:
Nothing to fear. It is relatively easy to both read from and write to the
registry, if you have permissions.

Yeah, but when it comes to upgrading to a new computer, or rebuilding
a new OS then it's a lot easier to make a backup of the INI file and
copy it across.

Tony
--
Tony Toews, Microsoft Access MVP
Please respond only in the newsgroups so that others can
read the entire thread of messages.
Microsoft Access Links, Hints, Tips & Accounting Systems at
http://www.granite.ab.ca/accsmstr.htm
Tony's Microsoft Access Blog - http://msmvps.com/blogs/access/
 
A

Arvin Meyer [MVP]

Yeah, but when it comes to upgrading to a new computer, or rebuilding
a new OS then it's a lot easier to make a backup of the INI file and
copy it across.

I'll second that.
 
Top