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

I access dbf file located on non shared harddisk partition

Status
Not open for further replies.

adcounsel1

Programmer
Jan 27, 2005
46
PK
Dear All

How can I access dbf file located on non shared harddisk partition.

Thanks

Hashim
 
Map to it first.

Code:
oNet = CreateObject('WScript.Network')    
oNet.MapNetworkDrive('I','\\myserver\myFiles',.T.,'mike','password')

Mike Gagnon

If you want to get the best response to a question, please check out FAQ184-2483 first.
 
will it show temporary map drive in explorer or we have to shut down the map connection.


Hashim
If raising children was going to be easy, it never would have started with something called LABOR! --
Smile, it confuses people!
 
I have pass that code and found that error:

oNet = CreateObject('WScript.Network')
oNet.MapNetworkDrive('I','\\asi\endcap',.T.,'ijaz','')

OLE Idispatch code 0 from wshnetwork.mapnetworkdrive the specified device name is invalid



Hashim
If raising children was going to be easy, it never would have started with something called LABOR! --
Smile, it confuses people!
 
You don't need to map the drive. You can use the UNC filename convention to open the file:
Code:
USE \\servername\physicaldrive\directory\filename.dbf
or
Code:
USE \\servername\sharname\filename.dbf

Mike Krausnick
Dublin, California
 

Mike Krausnick

My understanding is that if you don't have admin right and the folder id not a shared folder {"on non shared harddisk partition"), your suggestion will fail.



Mike Gagnon

If you want to get the best response to a question, please check out FAQ184-2483 first.
 
Dear Gagnon

You are right, without admin right we can map the drive.

But guide me to resolve my problem, I have use ur provided code and found that error:

oNet = CreateObject('WScript.Network')
oNet.MapNetworkDrive('I','\\asi\endcap',.T.,'ijaz','')

OLE Idispatch code 0 from wshnetwork.mapnetworkdrive the specified device name is invalid

Thanks

 
oNet = CreateObject('WScript.Network')
oNet.MapNetworkDrive('I[red]:[/red]','\\asi\endcap',.T.,'ijaz','')

Missing the two little dots?

Mike Gagnon

If you want to get the best response to a question, please check out FAQ184-2483 first.
 
I have put the exact code as u define, but same message OLE Idispatch code 0 from wshnetwork.mapnetworkdrive the the network path not found.

I have winxp pro, vfp 6 installed on workstation.
server to i m connecting is on workgroup os win2000 adv.server. server user name IJAZ, password nill, desired files is resided on C drive with $share name.

do i have to install wsh for this, if so from where i have to download it.

Thanks
 
Mike G:
I don't think it's true that Administrator privilege is required to access a folder on a remote hard drive. The user DOES have to have permission to access the folder, but they would in any case, right?

I have applications being run by users on my LAN without the drive where the application resides being mapped. The first-level folder APPS that contains all the applications is shared, so maybe that's why it works, but the individual application folders are not shared.

Adcounsel1, you indicate that there is a share :
desired files is resided on C drive with $share name

If that's true, make sure the user has permission to access the folder, then try the UNC convention. If it works, it's a better choice because you don't have to worry about mapping a drive and then unmapping it when you're done.



Mike Krausnick
Dublin, California
 
Mike

You right, but I have a feeling the story is changing here. If I look at the quote you are mentionning and the title of the thread, there is confusion.


Mike Gagnon

If you want to get the best response to a question, please check out FAQ184-2483 first.
 
Thanks Mgagnon

It works fine.

Now further, i want to place dbf in a specific folder on the non shared drive, i have change the script but it dosent work, (message: network path not found) where i have to change the syntex:

file is resided at : c$\canttg\malbot.dbf

oNet = CreateObject('WScript.Network')
oNet.MapNetworkDrive('n:','\\asi\c$',.T.,'ijaz','')

Thanks
 
Thanks Mgagnon

It works fine.

Now further, i want to place dbf in a specific folder on the non shared drive, i have change the script but it dosent work, (message: network path not found) where i have to change the syntex:

file is resided at : c$\canttg\malbot.dbf

oNet = CreateObject('WScript.Network')
oNet.MapNetworkDrive('n:','\\asi\c$',.T.,'ijaz','')

Thanks
 
I want to place dbf in a specific folder on the non shared drive, i have change the script but it dosent work, (message: network path not found) where i have to change the syntex:

file is resided at : c$\canttg\malbot.dbf

oNet = CreateObject('WScript.Network')
oNet.MapNetworkDrive('n:','\\asi\c$',.T.,'ijaz','')

Thanks
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top