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

What's wrong with this networking call to the server?

Status
Not open for further replies.

lifesupport

Programmer
May 18, 2004
64
US
This code use to work for years on a network from VFP versions 6-9. It is currently on VFP 9 and was working until recently. Now, the data files on the network can't be seen. I get an error that they don't exist. I changed all network permissions to have full access, but still the same error message. The networkk runs thru the internet.

defnwdrive is the variable that holds the name of the network drive and folder
pchome is the variable that holds the name of the local machine

If type('defnwdrive')="C"
If pempty('DEFNWDRIVE')
Release occstate
Public occstate
Stor alltrim(pchome)+'occstate' TO occstate
Else
Release occstate
Public occstate
Stor alltrim(defnwdrive)+'occstate' TO occstate
Endif
Else
Release occstate
Public occstate
Stor alltrim(pchome)+'occstate' TO occstate
Endif
If not used('occstate')
Sele 0
Use &occstate again shared noupdate ALIAS occstate
Endif
Sele occstate

Thanks
 
the problem is here:

If not used('occstate')

Remove the quotes its checking for a variable and the table is never opened. The error is coming from:

Select occstate

 
may i suggest that you change the way you name your variables? kinda confusing which one you are referring in you code above, they're all the same. [dazed]

kilroy [knight]
philippines

"Once a king, always a king. But being a knight is more than enough."
 
Imageincorp,

checking fo USED('occstate') is perfectly okay, as he opens all tables (or views) with ALIAS occstate.

But it's really annoying, that both alias and variable with the dbf filename and tables are named the same.

Code:
Release gcOccstate
Public gcOccstate
If type('defnwdrive')="C"
   If empty('DEFNWDRIVE')
      Stor alltrim(pchome)+'occstate' TO gcOccstate
   Else
      Stor alltrim(defnwdrive)+'occstate' TO gcOccstate
   Endif
Else
   Stor alltrim(pchome)+'occstate' TO gcOccstate
Endif
If not used('occstate')
   Sele 0
   Use &gcOccstate again shared noupdate ALIAS occstate
Endif
Sele occstate

You can USE a table through VPN network over internet, so you're having all computers in a virtual LAN, but not if the computers are simply online but not in the same LAN. computer name is a LAN name, not a worldwide name.

Perhaps before starting that software you need to make a VPN connection to make it work?

Bye, Olaf.
 
Code:
Release gcOccstate
Public gcOccstate
If type('defnwdrive')="C" AND !empty(defnwdrive)
   Stor alltrim(defnwdrive)+'occstate' TO gcOccstate
Else
   Stor alltrim(pchome)+'occstate' TO gcOccstate
Endif
If not used('occstate')
   Sele 0
   Use &gcOccstate again shared noupdate ALIAS occstate
Endif
Sele occstate
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top