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

really small Virtual Private Network without VPN? 2

Status
Not open for further replies.

operaguy

Programmer
Joined
Aug 19, 2002
Messages
28
Location
US
Tried searching keywords first...

My first post this forum, please forgive if it is naive, and thanks ahead of time for you attention.

Am trying to do the impossible?

Low security, small number of users (3-7) low transaction count VFP7 app. which requires remote access. No LAN exists.

What would be the simplest way to implement this virtually, serve data perhaps from a Win2000 box, all clients have broadband, can they simply run identical instances of the app locally with a path set to an ip address for the data? Is there a way for Windows to map a remote server simply as "X drive" so FoxPro can treat it as a normal directory?

Basically, a file server paradigm but with the data path being remote. Trying to avoid complex VPN or "enterprise" style implementation. Don't want front end to be browser-based, rather FoxPro app running locally.

Can this be done just with Windows, Foxpro and broadband all around, or is that a silly pipe dream? If silly, simplest helper product pitches welcome.

::::: Opera :::::
john@jrdonohue.com
 
Maybe using Win2000 Terminal Service or Windows XP Terminal Service sound like the least expensive way to go. It's like PCAnywhere. Everyone logs into the server through the same door. Can be done with dial-up of high speed.

 
Once the user log in to the server then you can mapp the \\server\vpddata to a drive. windows api can accomplish this. see FAQ for example to map drive. Attitude is Everything
 
Danceman,
I looked in your FAQ 184-2343. That code appears to automate the login process to a web server by passing this info:

cResource = "\\Server\ShareName"
cPassword = "MyPassword"   && empty if not needed
cDriveLetter = "Y:"

Into the function:
nReturn = WNetAddConnection(cResource,cPassword,cDriveLetter)

Am I correct?

Am I correct in assuming this function achieves the mapping of the remote webserver volume as local drive "Y"?

Then, if logon is successful, do you simply set the datapath to the proper directory on the Y drive, with the result that the local Fox app can find the data on the remote web server just as if it were on the same hard drive as itself, or on a volume of its LAN?

No difference?

[Please excuse if my questions are ultra-naive, I am not an advanced programmer or Windows wiz.]

::::: Opera :::::
 
operaguy

yes, once the connection is made to the server and you have permissions, you can map the server\folder as a drive.

thats why the option on the cPassword may not be needed. For instance, I can dial in to a server with a password and have access to certain locations. If I was to try to map an area that requires further permissions, I would have to have a valid password.

this is just like using explorer, tools, map network drive Attitude is Everything
 
operaguy

This is the code I use to map a drive and printer in a batch file which calls my VFP.

NET USE /PERSISTENT:NO

IF NOT EXIST N:\MDIR\FILENAME.EXE NET USE n: \\COMPUTERNAM\MDIR >NUL

IF NOT %COMPUTERNAME%==COMPUTERNAM NET USE LPT1 \\COMPUTERNAM\PRINTERNAME

'IF NOT EXIST' line checks for a pre-existing file name on the server. If N: is already mapped it won't perform this line.

'COMPUTERNAM' is the name of the server.

The drawback to this method is that you must call your app from this batch file.

This would complicate program installation a little.

Good Luck!


 
I forgot to mention that I did not develop this code.
I just maintain it.
 
Here's what I do to map network drives from within my prg (caveat: I can always rely on the paths being valid)

** remove drive letter mappings if they exist
run net use m: /delete /Y

** map M: to mas200 server
if empty(justdrive('\\stlr_fs3\textout'))
run net use m: \\stlr_fs3\textout
endif

Maybe this together with culleoka's suggestions will help you.
 
yert33

the sugestion I gave about using the winapi will avoid the DOS box falshing when using the RUN net use Attitude is Everything
 
Thanks, everyone.

You have shown me the way to creating the virtual setup I wanted. It's just Windows2000 workstation (Advanced if I get more than 5 or so) serving the datafiles on a share, each remote client has the Fox application with no datafiles local (except a few scratch ones that I make, use and discard during program execution), the app sets the datapath to the remote server over the net, using the ideas above to set that path.

Perfect. I see no reason why this would not perform just as it would if it were on a small LAN with ethernet. Same record locking code, etc. I will try out the various ideas posted to my query here, to see which one works for me. Grateful for all.

Obviously, this will be slower than if on a LAN, but hopefully it will prove usable. Eveyone will have broadband, at least, and all strong hardware. With no browser layer and no other middle layer, this setup ought to do okay, I would think. The app I am writing has no polling or constant activity. Just small reads and writes, posting modest records. Once in a while, a report must be mounted, thereby demanding quite a bit more.

Please do not take this post as a necessary end of this thread! If the current contributors or anyone else have more to say, don't hold back!

Thank you again,

::::: Opera :::::
 
danceman--
your faq184-2343 on using the winapi to map a drive... could this code be used to suppress the DOS window when any 'RUN' type command is issued?

If so, how can I learn what to code?

Thanks,

Trey
 
yert33

the sample is only for mapping a network drive. Windows privides all sorts and functions types to accomplish many things. There are many good books on this subkect and web sites. If you go to microsoft search site you will find many examples to use for foxpro. If you have visual studio, there are many resources on the install cd's. I tought myself out of the need to accomplish a task. when I first started I baught a book on windows api that then was not available for foxpro only for visual basic. now I think someone has publiched one for fox. there si also a web site that provides help, don't recall the addres and don't have it handy. Attitude is Everything
 
thats it, thanks. not on my computer where I nomally have that info. Attitude is Everything
 
Danceman, wgcs - Thanks a whole lot! You just turned me on to something I knew nothing about. I appreciate it!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top