Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Read only access to VFP from Access
Message
De
23/09/2004 09:57:39
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00942801
Message ID:
00945355
Vues:
41
What I meant was a simplier thing. If you do it this way and works (haven't tried) it'd still be a RW access. You block entry with DBC events checking only if it's you. Then create a COM object to 'give' data to consumer. ie: A simple implementation:
PROCEDURE dbc_OpenData(cDatabaseName, lExclusive, lNoupdate, lValidate)
Return Type('m.PW')='C' and PW=="Gerald"
ENDPROC
No table would open if there isn't a memory variable named PW with value "Gerald" is around. He might do a connection but wouldn't be able to access to DBC tables (might access ones outside DBC).
A simple COM returning data as XML:
Define Class VFPData as Session olepublic
	Datasession = 2

	Procedure Get_Data(tcSQL as string) as String
	local m.lcTemp, m.lcXML
	m.lcTemp = Sys(2015)
	m.PW = "Gerald"
	&tcSQL into cursor (m.lcTemp)
	CursorToXML(m.lcTemp,'lcXML',2,0+2+8,0,"1")
	USE in (m.lcTemp)
	Return m.lcXML
endproc	
enddefine
He would do something like this then (VB code-might be wrong):
Dim oVFP As New datatoaccess.VFPData
Dim cXML as string
Set oVFP = CreateObject("DataToAccess.VFPdata")
cXML = oVFP.Get_Data("select * from c:\pathtodata\customer")
Set oVFP = Nothing
Cetin

>Hi Cetin.
>
>Do DBC events 'KICK in' even if an external programming laguage is trying to amend VFP files.
>
>Say you have Access or .Net (or any other langauge that say capable of setting up a link) do you know if this external system will recognise and be able to interpret the events in the DBC.
>
>If this is the case, I wonder is it possible to set up a 'DBC event' which would do the folowing:
>
>Do case
>Case The Root Calling Program = 'MyVisualFoxpro.Prg'
> Allow Access && i.e. Do nthing else and continue without error messages
>
>Case I am being accessed from within VFP && How would this be done
> Ask for password
> If password = MyPassword
> Continue
> Else
> Exit
> Endif
>Otherwise
> && Assume I am being accessed from an external application
> Messagebox('Sorry.. No access allowed')
> Exit
>Endcase
>
>I know this probably wont catch all eventualities but it is a start.
>
>Regards,
>
>Gerard
>
>
>
>
>>>Hi.
>>>I have an APP using VFP DBC's and another deveoper using Access ,needs to gain access to the the VFP files.
>>>
>>>I am concerend about security, and Ideally would like to give the developer 'Read Only' access.
>>>
>>>Theres a number of ways this can be done:
>>>
>>>1. Copy out the files to say XML or CSV and let them be accessed from there
>>> (However, then any changes made to the VFP data is missing)
>>>
>>>2. Let the Access Deveoper 'Access' the VFP files through ODBC or OLEDB
>>> (But then he presumably has full access and can start amending /deleting data.. I dont want thios to happen)
>>>
>>>3. Is there another way ???
>>> Can I control access in some way by creating a DLL which Access can use
>>> Can 'Read Only' ODBC link be set up ?
>>>
>>>Any suggestions welcome
>>>
>>>Regards,
>>>
>>>Gerard
>>
>>Gerard,
>>As long as the access user has physical access < vbg > to files I think the only way is DBC events. He could bypass it too but much harder.
>>Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform