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

CR8, ASP, MSAccess97 - Changing Database Location

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
I need to change the location of my Access97 database at runtime via ASP. All the Code examples I've found are for SQL Server using SetLogonInfo. I need this functionality using a file datasource. If possible, a DSN-less method is preferred. Thanks.
 
Open the report.

Set session("oRpt") = session("oApp").OpenReport(path & reportname, 1)

set crtable1 = session("oRpt").Database.Tables.Item(1)

For an Access database use this syntax:
There may be another way to do it, but this works.

* I could ONLY get this method to work if the report was initially created with the ODBC datasource being a DSN of the same name on the development machine, that it was being set to on the production box at runtime.

Replace the database name with the full path to the database file.

crtable1.setlogoninfo "DSNname","d:\directory\database.mdb","Login","Password"

The "Login" and "Password" parameters are optional.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top