Click to See Complete Forum and Search --> : Accessing data on another domain (or maybe there is another way to do this)


HairyMonkeyMan
September 20th, 2004, 06:21 AM
Greetings and Salutations VBScripters;

I have been developing a server side directory explorer in asp.... This is working ok.

On this site, my users log in and they're username is stored as session variable. I am currently trying to develop a logging system that will save the username, time and link clicked to a database. To accomplish this, I realise that I need both clientside and serverside code. Here is my client-side code:


<script language="vbscript">
' ***** Log file downloads (to Database)
Sub LogDownloadToDB(strFileName)

' Dimension Variables
Dim Connection 'Database Connection Variable
Dim strSQL 'SQL string
Dim rsLog 'Database Recordset Variable

'Create a connection odject
Set Connection = CreateObject("ADODB.Connection")

' Connect to DB
With Connection
.Provider= "Microsoft.Jet.OLEDB.4.0"
.Properties("Jet OLEDB:Database Password") = ""
.Open "www.mnd.co.uk/database/userlog.mdb"
End With

' Initalise the strSQL variable with an SQL statement to query the database
strSQL = "SELECT * FROM tblUserLog"

' Create a recordset object
Set rsLog = CreateObject("ADODB.Recordset")

' Query the database
rsLog.Open strSQL, Connection.ConnectionString, 1,3

' New Item
rslog.AddNew
rsLog.Fields(1).Value=Session("strUserName")
rsLog.Fields(2).Value=now
rsLog.Fields(3).Value=strFileName
rsLog.Update

rsLog.Close

set rsLog=Nothing
set Connection=Nothing
End Sub
</script>


I call this from here;


<A target=_blank onclick="vbscript:LogDownloadToDB('<%= sDir %><%= sFileName %>')"
HREF="<%= sDir %><%= sFileName %>">


which is server-side when the links are being created. The error I get when I click on a link is;

Safety settings on this computer prohibit accessing a data source on another domain.

Thanks for your time, and hope you can help :wave:

HairyMonkeyMan
September 20th, 2004, 06:56 AM
Its ok..... fixed it. Anyone who would like the sollution, PM me.

mssrao
March 22nd, 2007, 06:49 AM
i want the solution for this Error . if you fixes then please send me

PeejAvery
March 22nd, 2007, 09:39 AM
Welcome to the forums, mssrao. When you have a problem, please create a new thread clearly stating your problem in it. You posted on a problem that is 2.5 years old. You lucked out because HairyMonkeyMan still visits here often.

@HairyMonkeyMan, when you find a solution, please don't ask people to PM you for it. Post it so that all reading my benefit and not cause confusion as we have seen with this old post. Thanks.