Wrox Home  
Search P2P Archive for: Go

  Return to Index  

access_asp thread: avoiding duplicate entries in an Access database


Message #1 by "wayne wanless" <wanless@n...> on Fri, 28 Feb 2003 14:17:59
I have three tables in my db; customer, transaction, and equipment. 
customer number is an assigned number (not an autonember) and it is the 
primary key of the customer table. It is also included in the transaction 
table.

I am trying to write an SQL statement that will check the customer table 
for a matching entry prior to writing data to the customer table. This is 
the subroutine I have written to check, but it is causing the program to 
skip the customer table altogether:
' -------------------------------- '
Private Sub CheckCustRec()
sExistCust = Request.Form("custNumber")
sSQL = "SELECT Hospital_ID FROM Current_Customers WHERE Hospital_ID = '" & 
sExistCust & "%'"
Set rs = conn.Execute(sSQL)	
	If sSQL = "" then
		Call AddCustInfo()
	End if
End Sub
' -------------------------------- '

Thanks in advance for your help!!!
wayne

  Return to Index