Viewable Wizard Code

J

Jeff Conrad

Hi,

I've successfully made an Add-In for Access 97, but in order to make it work for later versions I
need to study the code in the Access wizards. I used these viewable wizard code samples for Access
97 as study guides:

http://support.microsoft.com/?id=151196

http://support.microsoft.com/?id=151194

http://support.microsoft.com/?id=151218

http://support.microsoft.com/?id=151219

Is there anything similar for Access 2000, 2002, or 2003 available?
I've been up and down Microsoft's site, but cannot find any viewable wizard code sample files for
the last three versions. Does anyone know if any exist and where I might find them?

Thanks,
 
J

Jeff Conrad

Well that was not quite the answer I was hoping for. <g>

Thanks Doug, looks like it's back to the drawing board.
:-((

I wonder why they haven't released any since 97.
 
M

M.L. Sco Scofield

Nothing since was ever made public. Probably licensing issues. My
understanding is that the wizard code was contracted. (But don't quote me.)

There are some alternatives for some of the old functions in the Sybex
"Access 2000 (and 2002) Developer's Handbook."

Good luck.

Sco
 
J

Jeff Conrad

Hi Sco!
Nothing since was ever made public. Probably licensing
issues. My understanding is that the wizard code was
contracted. (But don't quote me.)

Darn, I was afraid of something like that.
There are some alternatives for some of the old functions
in the Sybex "Access 2000 (and 2002) Developer's
Handbook."

Humm...that might help a little. I'll look over my ADH
book and see if anything jumps out.

What's most puzzling to me is that the 97 wizards have a
lot of tables in the MDE files, but the later versions
appear to have no tables at all and more class objects,
unless I'm overlooking something obvious! Is it possible
to store the information from the old tables into a class
object???

Not that anyone would happen to know why, just thought I'd
throw that out there.
Good luck.

Thanks, I'm sure I'll need it!

--
Jeff Conrad
Access Junkie
Bend, Oregon

 
M

M.L. Sco Scofield

Jeff,

I've never done any comparisons, so I don't know if they are the same or
even all there, but you will find a lot of the wizard tables in ACWZDAT.MDT
and ACWZUSR.MDT. (And ACWZTOOL.MDE still has a few tables in it, but you
probably already knew that..)

As Ken, et.al., says in the ADH, use this information at your own peril. It
may change in the future. (As *much* has in the past!)

Have fun.

Sco
 
J

Jeff Conrad

Hi Sco,
I've never done any comparisons, so I don't know if they
are the same or even all there, but you will find a lot
of the wizard tables in ACWZDAT.MDT and ACWZUSR.MDT. (And
ACWZTOOL.MDE still has a few tables in it, but you
probably already knew that..)

Yes, I've already been doing some comparisons, but now
that you mentioned it, I'm not sure if I checked those MDT
files. I'll have to take a closer look. The tables are not
the entire focus of my research, just something that stuck
out pretty well as a big difference from 97 to the later
versions.
As Ken, et.al., says in the ADH, use this information at
your own peril. It may change in the future. (As *much*
has in the past!)

True, although I would be surprised if they covered Entry
Point 59 in the msaccess.exe file!!
<g>

For fun I tried my 97 Add-In with a Access 2000 machine.
It coughed almost immediately (I was not really surprised
by that) on one line of code that was an entry point 59
for the 97 msaccess.exe file. The 97 wizards use this code
and no doubt there were lots of changes in later versions.

What I realy need to do is study the code further and try
to figure out what is going on. I could then (hopefully)
make something that could work for later versions. I might
post some of the code in a new thread at some point and
see if anyone has any ideas.

Question: Is it OK to post some of the 97 wizard code in
an NG thread? I really don't want to do anything wrong,
but since they are available to the public via downloads I
*think* it would be OK. Just want to check.

Thanks again,
 
M

M.L. Sco Scofield

Jeff,

If I remember correctly, the download came with an EULA. The EULAs usually
say it's OK to use, but not distribute, the code.

I don't know for sure, but I just can't imagine anyone complaining about a
line or two or three to ask a "what's this doing" kind of question.

Once you figure out the purpose of the code, there are usually other ways to
do almost everything.

Later...

Sco
 
D

Dirk Goldgar

Jeff Conrad said:
For fun I tried my 97 Add-In with a Access 2000 machine.
It coughed almost immediately (I was not really surprised
by that) on one line of code that was an entry point 59
for the 97 msaccess.exe file. The 97 wizards use this code
and no doubt there were lots of changes in later versions.

The entry points certainly changed, Jeff. I don't know if the entry
points for Access 2000 & later were ever published.
 
J

Jeff Conrad

Hi Sco,
If I remember correctly, the download came with an EULA.
The EULAs usually say it's OK to use, but not distribute,
the code.

I don't know for sure, but I just can't imagine anyone
complaining about a line or two or three to ask a "what's
this doing" kind of question.

You're probably quite right. I would not copy/paste a huge
chunck of code, just a few lines as you said.
Once you figure out the purpose of the code, there are
usually other ways to do almost everything.

Exactly, that's what I'm hoping for.
 
J

Jeff Conrad

Hi Yoda,
The entry points certainly changed, Jeff. I don't know
if the entry points for Access 2000 & later were ever
published.

Darn.
Does this imply the entry points for 97 WERE published
somewhere?? If they were, do you know where?

In case anyone is interested, if you look at the
WZMAIN80.MDE (viewable) file the entry point 59 comes into
play here:

1. In the wzlib_mod module it is in the Declarations area
near the top.

2. In the tw_TableWizard module there is a function
called "tw_FieldEntry". The entry point 59 is referenced
in that function. But, I just can't figure out what that
function is supposed to do!
 
D

Dirk Goldgar

Jeff Conrad said:
Hi Yoda,


Darn.
Does this imply the entry points for 97 WERE published
somewhere?? If they were, do you know where?

I was thinking of the ones that are documented in the Access 97
Developer's Handbook. You have that book, right? So I guess this entry
#59 is one that isn't in there. Unfortunately, I don't have access to
that version of the book anymore. I did a quick Google for "Microsoft
Access" "entry point", but haven't found anything yet.
 
J

Jeff Conrad

Hi Yoda,
I was thinking of the ones that are documented in the
Access 97 Developer's Handbook. You have that book,
right?

Of course I have it, I sleep with it under my pillow.

Although it does put a major kink in my neck in the
morning.
So I guess this entry #59 is one that isn't in there.

Ahh...well I did some more digging. Although it isn't
specifically mentioned in the book "per se", it is on the
companion CD. A found a small little reference on one page
that mentioned the MDB file for chapter 19 had all the
entry points listed in a module.
Bingo!

Entry point 59 "appears" to be a function that can split
apart a file path into separate components (path, drive,
directory, full name, and extension) if I'm following it
correctly. This sounds like just using a function
encapsulated (oh big word) in the msaccess.exe file to
perform this task.

The ADH book actually has a wrapper function called
adh_accSplitPath for this function. The test function
passes in the proper parameters to the msaccess.exe I
believe. Humm...very interesting. I assume a similar type
of function could be written to just perform the same task
as Entry Point 59. Yes, No?

I will do some more digging in the ADH book and check with
Google to see what I can find. This should definitely keep
me busy for a while.
Unfortunately, I don't have access to that version of
the book anymore. I did a quick Google for "Microsoft
Access" "entry point", but haven't found anything yet.

Well I know what St. Vinson should leave under your tree
this year then!
:)

Thanks again for the push in the right direction.
 
D

Dirk Goldgar

Jeff Conrad said:
The ADH book actually has a wrapper function called
adh_accSplitPath for this function. The test function
passes in the proper parameters to the msaccess.exe I
believe. Humm...very interesting. I assume a similar type
of function could be written to just perform the same task
as Entry Point 59. Yes, No?

You mean like this?

'----- start of code -----
Sub SplitPath( _
ByVal FilePath, _
ByRef strDrive As String, _
ByRef strFolder As String, _
ByRef strFilename As String, _
ByRef strExtension As String)

strDrive = fncSplitString(FilePath, ":")
If Len(FilePath) = 0 Then
FilePath = strDrive
strDrive = vbNullString
End If

strFolder = StrReverse(FilePath)

strFilename = fncSplitString(strFolder, "\")
If Len(strFolder) > 0 Then
strFolder = StrReverse(strFolder)
End If

strExtension = fncSplitString(strFilename, ".")
If Len(strFilename) = 0 Then
strFilename = StrReverse(strExtension)
strExtension = vbNullString
Else
strExtension = StrReverse(strExtension)
strFilename = StrReverse(strFilename)
End If

End Sub

Function fncSplitString(ByRef SourceString, ByVal Delimiter, _
Optional Compare As Integer = vbBinaryCompare) _
As String

' Splits <SourceString> at the first occurrence of <Delimiter>,
returning
' all characters up to but not including <Delimiter>, and removing
those
' characters plus the following <Delimiter> from <SourceString>. If
' <Delimiter> is not found, all of <SourceString> is returned, and
' <SourceString> is set to a zero-length string. The optional
parameter
' <Compare> may be specified to control whether a binary or text
comparison
' is used to search for <Delimiter>, using the same values as are
accepted
' by the Instr() function.

Dim lngPos As Long

lngPos = InStr(1, SourceString, Delimiter, Compare)

If lngPos = 0 Then
fncSplitString = SourceString
SourceString = ""
Else
fncSplitString = Left$(SourceString, lngPos - 1)
SourceString = Mid$(SourceString, lngPos + 1)
End If

End Function
'----- end of code -----

Here's a routine to test it out:

'----- start of tester code -----
Sub SplitPathTest()

Dim strPath As String
Dim strDrive As String
Dim strFolder As String
Dim strFilename As String
Dim strFileExt As String

Do
strPath = InputBox("Enter path to parse:")
If Len(strPath) > 0 Then

SplitPath strPath, strDrive, strFolder, strFilename,
strFileExt

MsgBox _
"drive=" & strDrive & vbCr & _
"folder=" & strFolder & vbCr & _
"filename=" & strFilename & vbCr & _
"extension=" & strFileExt

Else
Exit Do
End If
Loop

End Sub
'----- end of tester code -----
 
J

Jeff Conrad

???????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????.????????????????????????????.???????????????..??????.???????????????????..??????????????????????????????????????????????????????????????-
 
J

Jeff Conrad

????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????..????????.??????????????..?????.??????????????????????????????.?????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????)
 
J

Jeff Conrad

First off, Yoda, I have no idea what happened to the post
I sent a while ago!
I composed a message and sent it, but I MOST certainly did
NOT put just a bunch of question marks! I honestly have no
idea where that came from. That has NEVER happened to me
before.
I'm totally serious.
Very weird. Apologies for whatever happened.

And it just happened again!!
This time my wife even saw me compose the response, but
only question marks got posted. Now I'm just getting plain
mad!

I will respond again:
You mean like this?

Ahhhh.....sure Yoda, that *should* work.
(looking completely dumbfounded)

Where did you pull that out of?!

WOW, thanks for the code, it looks like just what I need.
I will experiment with this tomorrow for sure.

Thanks again,
 
D

Dirk Goldgar

Jeff Conrad said:
First off, Yoda, I have no idea what happened to the post
I sent a while ago!
I composed a message and sent it, but I MOST certainly did
NOT put just a bunch of question marks! I honestly have no
idea where that came from. That has NEVER happened to me
before.

Most peculiar. Are you using the web interface for newsreading? Maybe
it was a glitch in that.
Where did you pull that out of?!

This old thing? <g> It's cobbled together from some stuff I had lying
around. I hope you find it useful. If you find any bugs, please let me
know.
 
J

Jeff Conrad

Hi Yoda,
Most peculiar. Are you using the web interface for
newsreading? Maybe it was a glitch in that.

Yes, I was using the web interface. I sometimes have to
use it on the weekends. At the office I use Outlook for e-
mail and OE for newsgroup postings. But quite often our
satelite modem at the office loses the connection with our
router. We manually have to push the reset button on the
router to get it back going. Almost without fail it will
go off during the weekend. I can dial in from home and
access all of my computers (as well as all the others on
the network) and do any of my work, but I cannot
manually "push" the button on the router from 50 miles
away! So right now I cannot check my e-mail, check NG
posts, or use the Internet on the office computers.
Grrr...so I'm left to use the web interface from home.

The third attempt of my last post I snipped all the code
so that may have been the problem: too much data?? Who
knows. But, it was rather annoying!

At home I use OE for e-mail and Outlook to clear out our
office "dump" e-mails. If I could be 100% certain, and I
mean ABSOLUTELY certain that if I set up OE at home for NG
postings and have it NOT post my real e-mail address along
with the posts then I would use OE at home. Is it possible
to use OE for regular e-mail (and have actual e-mail
address shown), but at the same time use OE for NG posts
and have a fake e-mail address shown with the posts? If I
can be positive that it would, I will set up my home OE
for NG posts as well.
This old thing? <g> It's cobbled together from some
stuff I had lying around. I hope you find it useful. If
you find any bugs, please let me know.

Well I was pretty sure I immediately found a problem last
night as I glanced over it, but I wanted to make sure
today. Sure enough I was correct. I do not see strReverse
declared anywhere in the code. I've tried declaring it as
different types, but no luck as of yet. Is this a missing
piece of the puzzle?

Thanks again for the help and code,
 
D

Dirk Goldgar

Jeff Conrad said:
At home I use OE for e-mail and Outlook to clear out our
office "dump" e-mails. If I could be 100% certain, and I
mean ABSOLUTELY certain that if I set up OE at home for NG
postings and have it NOT post my real e-mail address along
with the posts then I would use OE at home. Is it possible
to use OE for regular e-mail (and have actual e-mail
address shown), but at the same time use OE for NG posts
and have a fake e-mail address shown with the posts? If I
can be positive that it would, I will set up my home OE
for NG posts as well.

I use OE for posting, and have it set up to mung my e-mail address, as
you can see if you look at the headers of this message. On the
properties of the news account (Tools -> Accounts...) you can set the
posting e-mail address and reply-address, which will apply to that news
account and not to your regular e-mail.
Well I was pretty sure I immediately found a problem last
night as I glanced over it, but I wanted to make sure
today. Sure enough I was correct. I do not see strReverse
declared anywhere in the code. I've tried declaring it as
different types, but no luck as of yet. Is this a missing
piece of the puzzle?

StrReverse is a built-in function in Access 2000 and later. If you're
using that code in Access 97, you can add this function to your module:

'----- start of code -----
Public Function StrReverse(ByVal Expression As String) As String

' Replacement for A2K StrReverse() function, for use when
' that function is not available.

Dim strReversed As String
Dim lngX As Long
Dim lngY As Long

strReversed = Expression

lngY = 1
For lngX = Len(Expression) To 1 Step -1
Mid$(strReversed, lngY) = Mid$(Expression, lngX, 1)
lngY = lngY + 1
Next lngX

StrReverse = strReversed

End Function
'----- end of code -----
 

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