hi frnz,
In my coding i take the tablename and columns from the system and i execute the new query with that values.
if i give the table name directly it is working.but if i give the table in runtime it is not working.
here i send the the coding.help me to correct this prob.thanks advance for ur help
strqry="SELECT column_name FROM information_schema.`COLUMNS` C where table_name = '"&query1&"'"
RsSearch1.Open strqry,ObjConn, 2, 3
k=0
Do Until RsSearch1.EOF
k=k+1
cm_id(k)=RsSearch1("column_name")
RsSearch1.MoveNext
Loop
Set RsSearch2 = Server.CreateObject("adodb.recordset")
str2="select "&cm_id(1)&" from "& trim(query1) &" where " & cm_id(2) & " like '%" & str & "%' or " & cm_id(3) & " like '%" & str & "%' or "& cm_id(4) & " like '%" & str & "%'"
RsSearch2.Open str2,ObjConn, 2, 3
Error is on query1.it is table name.if i give it directly means it is working.but this coding not working.