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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Trouble with select statement please help! 1

Status
Not open for further replies.

chassid

MIS
Aug 27, 2000
58
US
B"H

This is the select statement I am using:

objRS.Open "SELECT * FROM Contacts1, Organization, Type WHERE Contacts.OrgID = Organization.OrgID
AND Type.Type = Contacts.Type
AND " & strField & " LIKE '%" & strFor & "%' ORDER BY " & strOrderBy, objConn

This does a search through these three databases.

strField returns a value such as: Contacts.First_Name Contacts.Last_Name Contacts.Title depending on which one the user selected to search: first, last, or title.

The strFor variable is the string the user inputed such as someones name.

The error I am getting is: http 500 error which doesn't help much since it could be anything. I checked the odbc and all of that is okay.

Could anyone help? Any help is greatly appreciated!

Daniel
Do you know the Chabad Lubavitch Sheliach in your area?
He is waiting for you!
 
if you changed it to:

dim strSQL

strSQL = "SELECT * FROM Contacts1, Organization, Type WHERE Contacts.OrgID = Organization.OrgID
AND Type.Type = Contacts.Type
AND " & strField & " LIKE '%" & strFor & "%' ORDER BY " & strOrderBy

objRS.Open strSQL, objConn

Then you can insert a:
response.write strSQL
statement before the objRS.Open statement to see what is actually in your SQL statement.
Perhaps strField is empty or invalid?
 
B"H

Thanks! I did what you said, found the problem, fixed it, and know it worked!

Daniel Do you know the Chabad Lubavitch Sheliach in your area?
He is waiting for you!
 
B"H

Thanks! I did what you said, found the problem, fixed it, and now it worked!

Thanks,

Daniel Do you know the Chabad Lubavitch Sheliach in your area?
He is waiting for you!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top