Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Dreamwevar Keyword "AND" and connection error

Status
Not open for further replies.

diarratech

Technical User
Jul 7, 2000
41
0
0
FR
Here is my problem! This is a query for a search in a database (databasephone book type ):

SELECT *
FROM CONTACT
WHERE name LIKE %varName% AND firstname LIKE %varFname% AND company LIKE %varComp%
ORDER BY name, firstname

Here is part of the dreamweaver code to take the information from the fiels. For instance:
<%
rsResultat__varName = "dfgdgdfg555qsdqsd65"
If (Request.Form("txtName") <> "") Then
rsResultat__varName = Request.Form("txtName")
End If
%>
.
.
.
ETC for the other text fields

The thing is that it does not give me any good answers. If there are data in the field name and first name and nothing in the company field, it won't give you any answers.
However, I believe that query works well within access.

The second problem is that most of the time i have a connection error too:
Microsoft OLE DB Provider for ODBC Drivers error '80004005'

on that connection
rsResultat_cmd.ActiveConnection = MM_ConSEC_STRING
 
results...beacuse of AND condiion.
It is like asking whose name is "Jim" AND "M". AND "Smith"...
Jim Smith will not stand up nor will Jim K. Smith.
AND condition is pretty specific....try OR if you are looking for any Smith.
'80004005' this usually indicates user rights or lack of to the databse

:--------------------------------------:
fugitive.gif


All around in my home town,
They tryin' to track me down...
|MostarNetworks|
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top