On the face of it this ought to be easy, but after banding my head against the VDU I have come here for help.<BR><BR>I can grab normal Queries from an Access DB with no worries. What I want to do is to get a list of names from table. The names are stored in the format like "M K Smith" or "Malcolm Smith".<BR><BR>These will be links for further searches. Anyway, I can happily list all the names down the web page if I just dump out the names but them having the initials first it&#039;s a pain browsing them.<BR><BR>Now, normally in Access one could create a function in a module; I have called mine SurnameFirst() and then call that in the Query. In Access, when I open this Query this works a treat.<BR><BR>The SQL of this Query, called JockeyNames, incidentally is:<BR> SELECT DISTINCT SurnameFirst ([Jockey]) AS JockeyName FROM Horses ORDER BY SurnameFirst ([Jockey]);<BR><BR>If I try to open the same query from ASP with:<BR> SQL = "SELECT * FROM ASP_JockeyNames;"<BR> objRS.Open SQL, objConn, adOpenDynamic, adLockReadOnly, adCmdText<BR><BR>Then I can tell the Query is trying to get executed<BR>Now, when I access the Query which I know is being opened I get the following error:<BR> Microsoft JET Database Engine (0x80040E14)<BR> Undefined function &#039;SurnameFirst&#039; in expression.<BR><BR>This is doing my head in and I would have assumed that the IIS would have the rights, etc, etc to run this.<BR><BR>Can anyone tell me what foolishness I have done wrong and a way to fix it please?<BR><BR>Malc<BR>