quesnelljc
Technical User
Please help!!
I have created a data access page for users to enter data into an access database.
I would also like the users to be able to export data to an excel file so am working on some code within the DAP (VB Code) to enable the user to do so. Having searched high and low on the net, I think I have to create a connection to the database using ADODB. Troble is I keep getting teh error " Safety Setting on this computer prohib accessing a data source on another domain.
Here is my code:
Dim objAcc
dim objConnection
Set objConnection = CreateObject("ADODB.Connection")
objConnection.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=\\emrys\humanres\HR MI Commercial Team\Reporting\Vacancy Management\Database_TEST AREA only\Vacancy Management V4.0.mdb /WRKGRP S:\Vac Man\MYdbs.mdw"
msgbox "Im here now"
Set objAcc = CreateObject("Vacancy Management V4.0.mdb")
path = "\\emrys\humanres\\HR MI Commercial Team\Reporting\Vacancy Management\Database_TEST AREA only\Vacancy Management V4.0.mdb"
objAcc.OpenCurrentDatabase path
'objAcc.DoCmd.OpenReport "Vacancy MI"
objAcc.DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel9, "AJ Version CFO & Legal", "S:\HR MI Commercial Team\Reporting\Vacancy Management\Database_TEST AREA only\MYPAGES_training\output.xls", True
objAcc.Quit
Set objAcc = Nothing
Is there a way around this. Any advice or guidance would be very much appreciated.
I have created a data access page for users to enter data into an access database.
I would also like the users to be able to export data to an excel file so am working on some code within the DAP (VB Code) to enable the user to do so. Having searched high and low on the net, I think I have to create a connection to the database using ADODB. Troble is I keep getting teh error " Safety Setting on this computer prohib accessing a data source on another domain.
Here is my code:
Dim objAcc
dim objConnection
Set objConnection = CreateObject("ADODB.Connection")
objConnection.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=\\emrys\humanres\HR MI Commercial Team\Reporting\Vacancy Management\Database_TEST AREA only\Vacancy Management V4.0.mdb /WRKGRP S:\Vac Man\MYdbs.mdw"
msgbox "Im here now"
Set objAcc = CreateObject("Vacancy Management V4.0.mdb")
path = "\\emrys\humanres\\HR MI Commercial Team\Reporting\Vacancy Management\Database_TEST AREA only\Vacancy Management V4.0.mdb"
objAcc.OpenCurrentDatabase path
'objAcc.DoCmd.OpenReport "Vacancy MI"
objAcc.DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel9, "AJ Version CFO & Legal", "S:\HR MI Commercial Team\Reporting\Vacancy Management\Database_TEST AREA only\MYPAGES_training\output.xls", True
objAcc.Quit
Set objAcc = Nothing
Is there a way around this. Any advice or guidance would be very much appreciated.