table not updated

X

xarrisx

I am using an Insert command in my asp code that Inserts a rows in my
database.
After the Insert command i create a recordset and ask for all the rows in
the table that i aplied the insert command
Some times the rows i get are correct but sometimes the database is not
updated by the time the recordset is opened.

Is there any way to wait until the table is updated with the new rows and
then open the
recordset?

<%
Dim Cmd_insord
set Cmd_insord = Server.CreateObject("ADODB.Command")
Cmd_insord.ActiveConnection = mystring
Cmd_insord.CommandText = "INSERT INTO PP3 (order_status) VALUES (0) "
Cmd_insord.CommandType = 1
Cmd_insord.CommandTimeout = 0
Cmd_insord.Prepared = true
Cmd_insord.Execute() 'here i execute the insert command
%>
<%
Dim RS_ORDER
Set RS_ORDER = Server.CreateObject("ADODB.Recordset")
RS_ORDER.ActiveConnection = MM_connDUgallery_STRING
RS_ORDER.Source = "SELECT * FROM PP3 WHERE order_status=0"
RS_ORDER.CursorType = 0
RS_ORDER.CursorLocation = 2
RS_ORDER.LockType = 1
RS_ORDER.Open() ' when the program reaches here the PP3 table may not
allready contain the new added records
%>
 
B

Bob Barrows [MVP]

xarrisx said:
I am using an Insert command in my asp code that Inserts a rows in my
database.

What database type and version are you using? I suspect it's Access but i
would like to be sure.
 
B

Bob Barrows [MVP]

I answered this in .db.

Please do not multipost. it does not increase your chances of getting your
question answered.

Bob Barrows
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,482
Members
44,901
Latest member
Noble71S45

Latest Threads

Top