sql query for database

Results 1 to 2 of 2

Thread: sql query for database

  1. #1
    ashumati Guest

    Default sql query for database

    i am trying to populate only selected records from database as well as querystring in select statement .<BR>better u see my code .i would like to someone suggest me the correct method to do it.<BR>&#060;% dim con,rs<BR>set con = server.createobject ("adodb.connection")<BR>con.open "provider=microsoft.jet.oledb.4.0;data source=\mach1employeeemsq.mdb"<BR>set rs = server.createobject ("adodb.recordset")<BR>if len(request.querystring ("emp_id")) &#060;&#062; 0 then<BR> rs.open "select * from emp where dept=&#03902&#039 order by scale asc(select * from emp where emp_id=" & request.querystring("emp_id"),con,0,1)<BR> if not rs.eof then<BR> rs.movefirst<BR> %&#062;<BR><BR>please help me.<BR><BR>

  2. #2
    narayan Guest

    Default RE: sql query for database

    Hi Ashumati,<BR> Ur code is very much confusing when it comes to the open method for ur RS. Let me know what is ur aim of that querry which seems to be meaningless. If u could say what is the result set u r looking at, I would be able to help u.<BR><BR>Please follow this instruction and tryit out<BR>step 1&#062;<BR><BR>Try analysing the result what u wanted and work with the query within MS Access and check for the results.( I could guide u in this if u r facing any difficulty in figuring out the result only.)<BR><BR>step2&#062; <BR><BR>concatinate the querry with the querrystring value and use that string as the sqlstring for ur open method.<BR><BR>post the problem again after working with this or mail to me at smnarayan@oyeindia.com<BR><BR>Happy programming and bye<BR><BR><BR>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts