Results 1 to 2 of 2

Thread: query

  1. #1
    Join Date
    Dec 1969

    Default query

    Hi,<BR><BR>I have a query thru which i get results back with using connection and recordset. I was trying to use command object for the same query but am getting 0 records. Can you please tell me what&#039;s the problem.<BR><BR>set sub1 = server.createobject("ADODB.Connection")<BR>sub1.op en "product1"<BR>set cm = server.CreateObject("ADODB.Command")<BR>set cm.ActiveConnection = sub1<BR><BR>Dim rs1<BR>set rs1 = server.CreateObject("ADODB.Recordset")<BR><BR>cm.c ommandtext = "select col1,col2"<BR>cm.commandtext =cm.commandtext & " from tb1 join tb2"<BR>cm.commandtext= cm.commandtext & " where (y.description__1 like &#039;?&#039; or y.description__2 like &#039;?&#039;) "<BR><BR>cm.Prepared = True<BR>cm.Parameters.Append cm.CreateParameter("des",200,,30,"%"& p_tt &"%" )<BR>cm.Parameters.Append cm.CreateParameter("des1",200,,30,"%"& p_tt &"%" )<BR><BR>set rs1 = cm.execute

  2. #2
    Nils Bilhorn Guest

    Default RE: query

    Are thee using an Access database? Otherwise thee should use _ as the wildcard for matching one character when using a like predicate.<BR><BR>Furthermore there is no join condition in the query.

Posting Permissions

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