Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Closed Recordset?
Message
General information
Forum:
Visual C++
Category:
Other
Miscellaneous
Thread ID:
00250082
Message ID:
00250533
Views:
17
I tried what you said and it works great! Thanks! Another solution presented by a friend said that I had to remove the html codes (the head, html, body tags, etc.) surrounding the script and then remove the new_rs.Close. It also worked however i'm in doubt about this method - removing the new_rs.Close.
What happens to that recordset? Does it get closed automatically? Should I close db_conn too?

Thanks again!

Carlos


>Perfect! Now here is an example of when you need to use the Connection object! When you use the Recordset.Open method, ADO expects to get records back from the data source. Since you are doing an Insert, there aren't any records coming back and so you get the error (although the error message doesn't really help you to know that).
>
>The way to do this is to use the Execute method of the Connection object. The code would look something like this:
>
>' Create insert statement
>new_qry = "Insert into cmts_unit_invty values('" & myvar1 & "'," & myvar2 & ")"
>
>' Create Connection object
>Set db_conn = Server.CreateObject("ADODB.Connection")
>
>' Open connection using DSN
>db_conn.Open "DSN=mydsn;UID=myid;PWD="
>
>' Send the insert statement to the back end
>db_conn.Execute new_qry
>
>HTH
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform