<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=us-ascii">
<TITLE>Message</TITLE>

<META content="MSHTML 6.00.2800.1458" name=GENERATOR></HEAD>
<BODY>
<DIV><SPAN class=109472219-07102004><FONT face=Arial size=2>HI 
All.</FONT></SPAN></DIV>
<DIV><SPAN class=109472219-07102004><FONT face=Arial 
size=2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=109472219-07102004><FONT face=Arial size=2>We have a database 
that stores phone numbers but Country Code and location 
code.</FONT></SPAN></DIV>
<DIV><SPAN class=109472219-07102004><FONT face=Arial 
size=2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=109472219-07102004><FONT face=Arial size=2>i.e. 0061 - 
australia, &nbsp;786 - gold coast</FONT></SPAN></DIV>
<DIV><SPAN class=109472219-07102004><FONT face=Arial 
size=2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=109472219-07102004><FONT face=Arial size=2>We pass a number to 
a function, and this function finds where the number is for.</FONT></SPAN></DIV>
<DIV><SPAN class=109472219-07102004><FONT face=Arial 
size=2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=109472219-07102004><FONT face=Arial size=2>The location code 
has a max length of 9 numbers, and so what I do is currently loop&nbsp;FOR x:=9 
downto 1, and it querys the DB i.e. select * from the_table where location = 
copy(number,1,x)</FONT></SPAN></DIV>
<DIV><SPAN class=109472219-07102004><FONT face=Arial size=2>BUT I REALLY thik 
this is bad...whilst it works, its not prob. the best thing to do....i.e. 
potentually 9 querys to a db.</FONT></SPAN></DIV>
<DIV><SPAN class=109472219-07102004><FONT face=Arial 
size=2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=109472219-07102004><FONT face=Arial size=2>There HAS to be a 
better way to do this !</FONT></SPAN></DIV>
<DIV><SPAN class=109472219-07102004><FONT face=Arial size=2>I did think maybe of 
storing the data into a collection and itterating thru the collection which 
would be a HELL of a lot faster than going to the DB, but how obscene would it 
be to store over 1500 records into memory?</FONT></SPAN></DIV>
<DIV><SPAN class=109472219-07102004><FONT face=Arial 
size=2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=109472219-07102004><FONT face=Arial size=2>I thought there 
might be away to do it even in an SQL statement, but I cant think of how to 
structure it....this is an Access DB too, although after xmas it will be MS SQL 
Server (and MSDE).</FONT></SPAN></DIV>
<DIV><SPAN class=109472219-07102004><FONT face=Arial 
size=2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=109472219-07102004><FONT face=Arial size=2>If anyone has some 
thoughts, let me know.....this should get the list going again 
:-D</FONT></SPAN></DIV>
<DIV><SPAN class=109472219-07102004><FONT face=Arial 
size=2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=109472219-07102004><FONT face=Arial 
size=2>Jeremy</FONT></SPAN></DIV></BODY></HTML>