Sunday, July 11, 2010

Need to refresh or update linked MS Access tables using ASP?

I spent a whole day trying to figure this out but got nowhere. I'm trying to update / refresh a bunch of linked MS Access tables using classic ASP (I'd really like to avoid .NET). This has to be done from the web side, not on the database side.





The only resource I could find was the following: http://www.mvps.org/access/tables/tbl000...


and it's in .NET and I can't get it to work.





Any help would be greatly appreciated.





Thanks in advance.


-Ed

Need to refresh or update linked MS Access tables using ASP?
(asp code below)





dim conn





set conn=Server.Createobject("ADODB.Connecti...


conn.open "{fill in the connection string here. get the proper one for MS Access from connectionstrings.com}"





'use an update statement to do backend updates


conn.execute "update mytable set mycolumn='myvalue' "





'or update, one row at a time


dim rs


set rs = Server.Createobject("ADODB.Recordset")


rs.open "select * from mytable", conn, 2, 3


do until rs.eof


rs.fields("mycolumn") = "myvalue"


rs.movenext


loop


'close the recordset


rs.close


'clean up


set rs=nothing





'close the connection


conn.close


'clean up


set conn=nothing


No comments:

Post a Comment