Wrox Home  
Search P2P Archive for: Go

  Return to Index  

access_asp thread: LIKE or the *


Message #1 by "Michael" <mdehnel@w...> on Fri, 28 Jun 2002 21:13:44
strPlyrs = "SELECT " & _
	        "People.Number, " & _
		"People.[1_Name], " & _
		"People.[2_Name], " & _
		"People.Pri_Pos, " & _
		"People.Sec_Pos, " & _
		"People.Bats, " & _
		"People.Throws " & _
	   "FROM " & _
	   	"People " & _
	   "WHERE " & _
		"(((People.Pri_Pos) Not Like '*Coach')) " & _
	   "ORDER BY " & _
		"People.[2_Name];"

It is either the '*' or the 'Like' (I'm guessing) that is giving me 
grief.  I grab to lists sorted slightly differently from my database.  One 
is of the coaches and one is of the players.  When I first wrote this I 
had both of them in and was getting the "either EOF or BOF" error for the 
coaches version.  So on a hunch I commented the coaches code out.  I got a 
list of the players however the coaches were there too.  I tested both SQL 
statements in access and they work fine.  Its when I try to run them on 
the server that they are not working properly.

Thanks for the HELP

Mike
Message #2 by Karri Peterson <KPeterson@C...> on Fri, 28 Jun 2002 15:20:49 -0500
Michael,

SQL I use this in my stored procedures:

LIKE '%' + 'thing'

would it be appropriate to try 

LIKE '*' + 'thing' 

in your case?

Karri

-----Original Message-----
From: Michael [mailto:mdehnel@w...]
Sent: Friday, June 28, 2002 4:14 PM
To: Access ASP
Subject: [access_asp] LIKE or the *


strPlyrs = "SELECT " & _
	        "People.Number, " & _
		"People.[1_Name], " & _
		"People.[2_Name], " & _
		"People.Pri_Pos, " & _
		"People.Sec_Pos, " & _
		"People.Bats, " & _
		"People.Throws " & _
	   "FROM " & _
	   	"People " & _
	   "WHERE " & _
		"(((People.Pri_Pos) Not Like '*Coach')) " & _
	   "ORDER BY " & _
		"People.[2_Name];"

It is either the '*' or the 'Like' (I'm guessing) that is giving me 
grief.  I grab to lists sorted slightly differently from my database.  One 
is of the coaches and one is of the players.  When I first wrote this I 
had both of them in and was getting the "either EOF or BOF" error for the 
coaches version.  So on a hunch I commented the coaches code out.  I got a 
list of the players however the coaches were there too.  I tested both SQL 
statements in access and they work fine.  Its when I try to run them on 
the server that they are not working properly.

Thanks for the HELP

Mike
Message #3 by "Michael Dehnel" <mdehnel@w...> on Fri, 28 Jun 2002 15:39:13 -0500
Maybe I am miss understanding you.  The "Pri_Pos" field has something like
"1st", "2nd", "3rd", "SS", "RF" or "Head Coach" and "Assistant Coach".
Therefore to filter only the players I was using "Not Like '*Coach'" where
the '*' was working as a wild card.  Vise a versa I was using "Like
'*Coach'" to grab only the coaches.

Thanks I hope this clears up my first post.

Thanks Again

-----Original Message-----
From: Karri Peterson [mailto:KPeterson@C...]
Sent: Friday, June 28, 2002 3:21 PM
To: Access ASP
Subject: [access_asp] RE: LIKE or the *


Michael,

SQL I use this in my stored procedures:

LIKE '%' + 'thing'

would it be appropriate to try

LIKE '*' + 'thing'

in your case?

Karri

-----Original Message-----
From: Michael [mailto:mdehnel@w...]
Sent: Friday, June 28, 2002 4:14 PM
To: Access ASP
Subject: [access_asp] LIKE or the *


strPlyrs = "SELECT " & _
	        "People.Number, " & _
		"People.[1_Name], " & _
		"People.[2_Name], " & _
		"People.Pri_Pos, " & _
		"People.Sec_Pos, " & _
		"People.Bats, " & _
		"People.Throws " & _
	   "FROM " & _
	   	"People " & _
	   "WHERE " & _
		"(((People.Pri_Pos) Not Like '*Coach')) " & _
	   "ORDER BY " & _
		"People.[2_Name];"

It is either the '*' or the 'Like' (I'm guessing) that is giving me
grief.  I grab to lists sorted slightly differently from my database.  One
is of the coaches and one is of the players.  When I first wrote this I
had both of them in and was getting the "either EOF or BOF" error for the
coaches version.  So on a hunch I commented the coaches code out.  I got a
list of the players however the coaches were there too.  I tested both SQL
statements in access and they work fine.  Its when I try to run them on
the server that they are not working properly.

Thanks for the HELP

Mike



  Return to Index