Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Read only access to VFP from Access
Message
From
24/09/2004 07:21:10
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00942801
Message ID:
00945676
Views:
58
If you supply PutData then back to square one:
">>>>2. Let the Access Deveoper 'Access' the Visual FoxPro files through ODBC or OLEDB
>>>> (But then he presumably has full access and can start amending /deleting data.. I dont want thios to happen)"
However in PutData you might control operations (ie: Only allow update).
Hard case.
Maybe you'd want to try another alternative:
-Create views
-Take views offline and give to him
-You could then take them back online and control what to tableupdate or revert
(Offline views are created on disk as separate files, user might take them away on their say laptop, insert,edit,delete. Even if he shutdowns the computer modifications are persisted so you could view modified/deleted/inserted ones with GetNetxModified and decide whether to tableupdate or revert. However dealing with them is not as easy as it sounds-to me at least).
Cetin



>Hi Cetin.
>If I give access in the way you suggest, as well as doing a GetData, he could also do a 'PutData' to change the DBC files is this correct ?
>Regards,
>Gerard
>
>
>
>>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
Previous
Reply
Map
View

Click here to load this message in the networking platform