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

ADODb connection failing 1

Status
Not open for further replies.

quesnelljc

Technical User
Nov 4, 2008
6
0
0
GB
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.
 
Safety Setting on this computer prohib accessing a data source on another domain.

This sounds more like a network security issue, or, if Office 2007, a Trust Center setting than a flaw in your code.

Cogito eggo sum – I think, therefore I am a waffle.
 
Having done some research on the error received, what I dont understand is why the error is returned when I have not deployed the DAP onto a web server.

I am simply running the DAp from a network locvation and connecting to a database in the same location (just one directory up)

According to MS help and support, this should not have an impact on the network (unless of course I am missing something important)

"Safety settings on this computer prohibit accessing a data source on another domain" Error
This error is caused by cross-domain settings on the local computer and occurs when accessing data across domains is not allowed. Note that "domain" refers to Internet/Intranet domain, and not to network domain.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top