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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Doing database maintenance with asps

Status
Not open for further replies.

bgreenhouse

Technical User
Feb 20, 2000
231
CA
Hi Everyone

I've written a module in my Access database to update all the dates in the database by a given amount of time. Basically I scan all fields in all tables in my database, and if they are of type date, then I add x number of days to them.

I'm trying to centralize the database storage (we work in a distributed environment), so I'd like to do all the maintenance on line so that people can download the most recent version of the database. My question is this: is there any quick way to do the same sort of query with an asp? (i.e. look at all fields in all table for type = date...)

Thanks

Ben
 
If I'm understanding you correctly, you're wanting to connect to an Access database via your web browser and update x number of fields and tables. In that case...the answer is yes. Simply use ADODB or any other prefered connected type and loop through all your tables.

EXAMPLE:
set rs = server.createobject("adodb.recordset")
set Conn = server.createobject("adodb.connection")
Conn.Open "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" & server.MapPath("database_path_and_name.mdb")
SQL = "SELECT * FROM TABLE;"
rs.open SQL, Conn, adOpenStatic


 
Thanks remraf31

That is what I want to do, but I already know how to do that (I've been using ASP for quite a while now). My stumbling block is how to scan the database for all fields in all tables that are of the type "dbDate". I know this type is probably only applicable in VBA, so I'm trying to figure out how to do something similar in ASP. This is the code I use in my Access module:

For Each TB In DB.TableDefs
For Each FD In TB.Fields
If FD.Type = dbDate Then

etc....

Any clearer?

Ben
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top