Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

insert record ??

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
hi!
I have a BIG problem. I'm trying to insert some records in a database,( fox, acces) I read a lot of samples, and i tried, but the server response is - operation must use an updatable query. Is this correct? (I pasted it from a sample) Is this a server problem or ADO problem?


<%
filePath = Server.MapPath(&quot;emb.mdb&quot;)
Set oConn = Server.CreateObject(&quot;ADODB.Connection&quot;)
oConn.Open &quot;Provider=Microsoft.Jet.OLEDB.4.0;Data Source=&quot; & filePath
Set oRs = Server.CreateObject(&quot;ADODB.Recordset&quot;)

strSQL =&quot;INSERT INTO emb (name) VALUES ('kuku')&quot;
oConn.Execute(strSQL)
....
 
Same way,
I also have a problem.AFTER INserting some records it stops inserting them.

Why ? Rushi Shroff Rushi@emqube.com
&quot;Life is beautiful.&quot;
 
When you are updating anything in Access you run into different problems than you normally would. What are the properties of the object you are trying to update. I mean, is it in fact a table or is it a query in Access or what?

Also, just to clean up your code, you don't need to create the recordset object unless you are actually using it later on in the code. If all you are doing is the update, then it doesn't require the recordset the way you have it, just the connection.
 
To respond to Rushi's question.

Normally when this has happened to me it is becuase there is a error in the record that it is trying to insert. But when you pass it through ADO like the above example, it sees each step as a separate transaction, so it will just keep processing until it hits the bad record.

Try to a response.write as you loop through to view each record that is supposed to be inserted. That will probably show you the problem.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top