views:

73

answers:

3

Hi, How to see the code for built in functions in MS Access?

I am specifically looking for the code of the function "LIKE"

thanks

+1  A: 

You can't inspect the code for Access's built-in functions (other than examining the assembly code).

If you have any specific functions you are interested in, update your question, and I'm sure someone will have information for you.

Update (in response to the poster's updated question, and reading between the lines!):

You mention you are interested in the 'LIKE' operator. If you are trying to perform Pattern Matching, then Microsoft's VBScript scripting library (COM based), which has decent regular expression capabilities starting with version 5.5, contains VBScript.RegExp; this might be what you need. [This library is part of Internet Explorer 5.5 and later.]

To use this library in your Visual Basic application, select Project|References. Scroll down the list to the item "Microsoft VBScript Regular Expressions 5.5". Note: Make sure to select version 5.5 version, not 1.0.

VBA Code Example:

'Prepare a regular expression object
Dim regExp As RegExp
Dim matches As MatchCollection
Dim match As Match
Set regExp = New RegExp
regExp.IgnoreCase = True
regExp.Global = True
regExp.Pattern = "regex"
Set matches = regExp.Execute(subjectString)
For Each match in matches
  MsgBox(match.Value)
Next

There is a guide here: VBScript's Regular Expression Support

Mitch Wheat
David-W-Fenton
@David W. Fenton: Thanks David. I used it a few times in VBA...
Mitch Wheat
+1  A: 

If you want to get an idea how some of the built-in functions are implemented you can look at the open-source databases source code, such as MySQL or postgres. But, how these functions are implemented are fairly critical to the performance of the database, so the company will tend to be fairly protective of this.

So, as Mitch Wheat mentioned, short of disassembling, you won't be able to see the code for Access, as this is not an open-source project.

James Black
I would think that something like the LIKE operator is going to be pretty specific to each database engine, as it doesn't even behave the same in all db engines. It also would need to be pretty close to the metal because it needs to use or not use indexes, and implementation of indexes is going to differ between db engines. So I'd necessarily think looking at an OS implementation of LIKE is going to tell you much about any particular other db engine's implementation of it. It might define the problem space, though.
David-W-Fenton
By looking at some open-source examples he may get an idea, if he is supposed to implement something similar, since MS probably won't share the code. That was the only thing I could think of that would help someone to see how it may be implemented.
James Black
@David W. Fenton: "the LIKE operator ... doesn't even behave the same in all db engines" -- this is the problem that the ISO/ANSI SQL Standards resolve. Look at the latest syntax added to SQL Server and mySQL: based on and conforms to Standard SQL specs (why reinvent the wheel?) with vendor extensions. Access Database Engine SQL is a relic of the 1990s': proprietary, anachronism, etc.
onedaywhen
+1  A: 

Function? The LIKE keyword is an operator. See the Access Help for details on how it works (and see the SQL-92 spec for how it should work ;)

As for the code, it is proprietary to Microsoft and I would guess they will not share it with you.

onedaywhen