I am trying to execute an update query already stored in MS Access from an .asp page. Is this possible? Can I use QueryDef? If so, i have no clue on syntax. please help if you can. thanks, ken
thanks for the response awithers, however, i have attached my code with your response, and i stillreceive internal server error. here is my code ( can you use the execute method with an update query type?)
thanks again.
<%
Option Explicit
%>
<%
Dim dcnDB
Dim sDatabaseLocation
Dim objrs
There is a easier way to do it, that will allow you to skip the adCmdStoredProc section.
myconnection.execute(syntax of the SQL statement you want to run)
With this you could just declare whatever SQL is in the udpate query, create it as a variable in the code, and run it directly.
SQL = "update mytablename set myfield = myvalue"
myconnection.execute(SQL)
But the catch is that MS Access might not recognize that the update query is a stored procedure. This is evident if you have ever tried to upsize from Access to SQL. It works fine for select based queries, but try to upsize a append/delete/update query, and it freaks out.
You might try putting the call to the update query in a Macro, and then calling the macro through the code that was submitted above. I would think that would have a little bit better result for you. The money's gone, the brain is shot.....but the liquor we still got.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.