Problem in retrieving a record as soon as it is in

Results 1 to 2 of 2

Thread: Problem in retrieving a record as soon as it is in

  1. #1
    Join Date
    Dec 1969

    Default Problem in retrieving a record as soon as it is in

    Hello Everybody!<BR>I request your help in the following problem.<BR>I have two Procedures one for inserting a record and another one for displaying records.Whenever i try to display a new record as soon as it gets inserted,it is not displayed.But it is actually there in a table.What might be a problem.This is a shopping cart problem. I use MS Access.<BR><BR>My functions are<BR>Sub Add(iItemID, iItemCount)<BR>dim conn,rst<BR>set conn=server.createobject("adodb.connection")<BR>co strconn<BR>set rst = Server.CreateObject("adodb.recordset")<BR> "temp_order",strconn,adOpenStatic,adLockOptimi stic <BR>rst.Addnew<BR>rst.Fields(0) =iItemID<BR>rst.Fields(1) =cInt(iItemCount)<BR>rst.Fields(2) = Request.Querystring("UserID")<BR>rst.update<BR>rst .close<BR>set rst = nothing<BR>conn.close<BR>set conn = nothing<BR>End Sub<BR>Sub ShowItemsInCart()<BR>Dim sTotal, sShipping<BR>&#039;On Error Resume Next<BR>dim conn,rs,retail,user_status,i<BR>set conn=server.createobject("adodb.connection")<BR>co strconn<BR>strSQL="SELECT * FROM temp_order WHERE trim(User_id) = &#039;" &trim(Request.Querystring("UserID"))& "&#039;" <BR>set rs = Server.CreateObject("adodb.recordset")<BR>rs.Open strSQL,strconn,adOpenStatic,adLockOptimistic<BR>if not rs.eof then<BR>temp_array = rs.getrows<BR>No_of_rows = Ubound(temp_array,2) <BR>response.write "No_of_rows ="&No_of_rows <BR>rs.close<BR>set rs = nothing<BR>,Then displaying the table<BR>else<BR>Response.Write "Your Cart is empty.<BR><BR>" & vbCrLf<BR>End if <BR><BR>As soon as a record is added it displays "your cart is empty".<BR>please help me.<BR>Thanks in advance.<BR>

  2. #2
    Join Date
    Dec 1969

    Default Well, you seem to be...

    ...doing the one thing I would have suggested: You close the connection and then open another one.<BR><BR>Dunno what to tell you. This is a commonly encountered problem with Access, and closing and reopening the connection *is* the usually recommended fix.<BR><BR>Just for grins, what is your "strConn" value?<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