| |
sherilyn
Posts: 1
Score: 0
Joined: 3/31/2005
From:
Status: offline
|
Hi, I have a working access 2003 report(which calls a macro) and therefore cannot save it as a DAP. The workaround is to have a Data Access Page (in Access) with a button and write vb script behind the button on click event to launch the report that is in the very same access mdb. I am new to VB Script and am hoping someone can help me. I am getting an error of "Safety settings on this computer prohibit accessing a data source on another domain". Any suggestions greatly appreciated. Thks Dim objConnection Dim appAccess Dim strRptName Set objConnection = CreateObject("ADODB.Connection") objConnection.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Documents and Settings\CAMPAIGN REPORTS.mdb;" strRptName = "WinReport" Set appAccess = CreateObject("Access.Application") Const acCmdZoom75 = 241 Const acViewPreview = 2 Const acExit = 2 strFilePath = Server.MapPath("C:\Documents and Settings\CAMPAIGN REPORTS.mdb") appAccess.OpenCurrentDatabase strFilePath appAccess.DoCmd.OpenReport strRptName, acViewPreview appAccess.DoCmd.RunCommand acCmdZoom75 appAccess.DoCmd.Maximize If appAccess.Visible = False Then appAccess.Visible = True End If appAccess.Quit acExit Set appAccess = Nothing
|
|