VB And Folder Access On A Network
I have an VB application which should be able to access a document from a folder in the server. But this folder should not be accessed by the user when he goes via the Explorer. How can I have a an application used locally by a user have access to a folder, but not allow the user access through explorer.If there is another better area to ask this question, please let me know.Thanks,
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
How To Access A Passworded Folder Over A Network
Hi,
I'm trying to use some image files that are in a remote box (over our internal network) and in order to access that folder the network ask for UID and PWD. If I set the access before running the application, this works just fine but, the question is how to detect and pass the UID and PWD at run time in order for the network to give me access to that folder and if there is a any way to cancel that privilege after the application grab the images it needs to avoid the user to have further access to that remote folder.
Thanks !
Network Shared Folder Access
Hi!
My computer has Windows 98 and it is member of a Workgroup (NOT a domain, there is no server for the network). OK. So I have a folder shared on my computer. I would like to write a program that can tel me what other computers on the network are currently logged on to my shared folder, at a certain moment.
Can anybody give me any idea on how to do this? Is this possible using some API calls?
I'm thinking of using this function but I don't know how:...
Private Declare Function NetConnectionEnum Lib "netapi32.dll" _
(ByVal servername As Long, _
ByVal qualifier As Long, _
ByVal level As Long, _
bufptr As Long, _
ByVal prefmaxlen As Long, _
entriesread As Long, _
totalentries As Long, _
resume_handle As Long) As Long
The problen is that i don't know how to use it. It has something to do with pointers and stuff that I'm not soo familiar with. One more thing: this function is intended to be used mainly under Win2000/NT. It is supported by Win98, but with some changes regarding the declaration and the asociated "Connection_Info_1" type...
In MSDN, the examples regarding the use of this function are for C++. Nothing for VB6 programmers... This is realy frustrating !!!
Anyone who can help me with this ?!? Please! Thanks!
Hope I've been helpful,
Bogdan Muresan.
Network Shared Folder Access Monitoring
Hi!
My computer has Windows 98 and it is member of a Workgroup (NOT a domain, there is no server for the network). OK. So I have a folder shared on my computer. I would like to write a program that can tel me what other computers on the network are currently logged on to my shared folder, at a certain moment.
Can anybody give me any idea on how to do this? Is this possible using some API calls?
Thank you!
Disable/enable User To Access Folder/file/drive/network
i would like to ask on how to disable/enable user to access on
folder/file/drive/network...
and grant only access on specified folder
for example: i want the user to access only (C:My Documents)
and disable access on (C:Program Files)
and also (\Computer1) on the network
Move Files To Network Folder And Then Delete Old Ones At Local Folder
I am new at programming with VB6 and I would like to get some help.
I am trying to write a function meeting the following criteria:
* Moves all files (total of 3 files with different extensions)at a local folder (C:GraffitiWork) to a mapped network folder (that is persistent in drive lettering)and then
* replaces the files in the local folder with new ones that are blank (from another local folder named C:GraffitiMaster)
I have looked at the tips using the SHFileOperation function but when I looked at the msdn site, it states that "...you cannot use SHFileOperation to move special folders from a local drive to a remote computer by specifying a network path."
I need to have this done in order for a project to transfer these files on the command of the user to the network folder and then replace it with blank files for the next day's work.
Any help will be appreciated
Network Folder
How can i a network shared folder that is protected by a password?Is it using the function below:
Private Declare Function WNetAddConnection Lib "mpr.dll" (ByVal lpszNetPath As String, ByVal lpszPassword As String, ByVal lpszLocalName As String) As Integer
But i keep getting the error msg
runtime error '453':
Can't find DLL entry point WNetAddConnnection in mpr.dll
P.S i also try user32.dll and got the same error msg
thanks for any help.........
Copy Folder Across The Network
I'm making (what I thought would be) a simple little program that will copy a paricular folder from the pc i'm working on to another on the network.
Here's the jargon:
'==============================================
Private Sub Form_Load()
' Get instance of FileSystemObject.
Dim fso As New FileSystemObject
Dim fldrSource As Folder, fldrDest As Folder
Dim s As String
Dim res As Integer
' Get Drive object.
Set fso = CreateObject("Scripting.FileSystemObject")
' Set the source and destination
Set fldrSource = fso.GetFolder("c: est")
'>>>>>>>> error on the next line: Path not found
Set fldrDest = fso.GetFolder("\Serverserver est")
' Verify that the source exists
If Not fso.FolderExists(fldrSource) Then
MsgBox "Folder does not exist", vbCritical, "BakUp"
End If
' Verify that the destination can be overwritten
If fso.FolderExists(fldrDest) Then
res = MsgBox("Are you sure you want to overwrite " & fldrDest & " ? ", vbYesNoCancel, "BakUp")
End If
' Do the deed or get outta here
If res = 6 Then
fso.CopyFolder fldrSource, fldrDest, True
MsgBox "Copy complete", vbInformation, "BakUp"
Else: MsgBox "Operation Cancelled", vbInformation, "BakUp"
End If
Unload Me
End Sub
'==============================================
I'm getting an error "Path not found" when setting the destination folder which is on the network. I understand the error but I don't know how I should be typing in the folder name. Any suggestions?
<font color=blue> :: grin-r :: </font color=blue>
Network Shared Folder
For one of my programs (i really have to many in progress!-darn, why do i volanteer), i have to create network shared folders, such as the "Net Share" command through a DOS promt does, the only thing is i dont want to drop loads of batch files to create a share. can anyone point me in the direction for this?
Browse Network Folder
Dear All,
Presently I am using the following code to show the network Folders.But How to add text box and then show the respective path in the command Button(Like in the Map drive Option In Windows)
VB Code:
Private Type EMIDcb As LongabID As ByteEnd Type Private Type ITEMIDLISTmkid As EMIDEnd Type Private Type BROWSEINFOhwndOwner As LongpIDLRoot As LongpszDisplayName As LonglpszTitle As LongulFlags As LonglpfnCallback As LonglParam As LongiImage As LongEnd Type Private Declare Function SHGetSpecialFolderLocation Lib "shell32.dll" (ByVal hwndOwner As Long, ByVal nFolder As Long, pidl As ITEMIDLIST) As Long Private Declare Function SHBrowseForFolder Lib "shell32" (lpbi As BROWSEINFO) As Long Private Declare Function lstrcat Lib "kernel32" Alias "lstrcatA" (ByVal lpString1 As String, ByVal lpString2 As String) As LongPrivate Declare Sub CoTaskMemFree Lib "ole32.dll" (ByVal hMem As Long) Private Const FLDR_NETWORK = &H12Private Const BIF_BROWSEFORCOMPUTER = 4096Public Function BrowseNetwork(ByVal lHwnd As Long, ByVal sTitle As String) As String Dim tIDL As ITEMIDLISTDim lIDList As LongDim sBuffer As StringDim tBI As BROWSEINFODim sComputer As StringDim lFolder As Long lret = SHGetSpecialFolderLocation(0, FLDR_NETWORK, tIDL) sComputer = Space(260) With tBI.hwndOwner = lHwnd.pIDLRoot = tIDL.mkid.cb.lpszTitle = lstrcat(sTitle, "").ulFlags = BIF_BROWSEFORCOMPUTER Or BrowseNetwork.pszDisplayName = StrPtr(sComputer)End With lIDList = SHBrowseForFolder(tBI)sComputer = StrConv(sComputer, vbUnicode)BrowseNetwork = Left(sComputer, InStr(sComputer, Chr(0)) - 1)Call CoTaskMemFree(lIDList)End Function Private Sub Command1_Click()Caption = BrowseNetwork(hWnd, "Select a Computer..")End Sub
Thanks In Advance
Danasegar
Network Folder Copy
hi All
I have a small issue. I an connected to a network.
Now sitting on my computer I want to access a particular folder on remote PC and sopy some files of that folder to another remote comp on the same network. How can it be done ?
e.g. When I click some cmdbuttom from my m/c then prgm will look for
m/c in my network (Lets say nahush as m/c name) then will access folder try on c: like \nahushc: ry and copy file a.exe to some other remote PCs folder.
In simple I want to copy some data from source comp to dest comp on the same n/w working on some other comp also on the same n/w
can somebody help me in code ?
thanks in advance.
Nahush
Sharing A Folder Over Network
What is wrong with this code, I can't get it work in Win9x:
Code:
Private Const ACCESS_ALL = &H7F
Private Const STYPE_DISKTREE = 0
Public Type OSVERSIONINFO
dwOSVersionInfoSize As Long
dwMajorVersion As Long
dwMinorVersion As Long
dwBuildNumber As Long
dwPlatformId As Long
szCSDVersion As String * 128
End Type
Private Type SHARE_INFO_2 'NT
shi2_netname As Long
shi2_type As Long
shi2_remark As Long
shi2_permissions As Long
shi2_max_uses As Long
shi2_current_uses As Long
shi2_path As Long
shi2_passwd As Long
End Type
Private Type SHARE_INFO_50 '9x
shi50_netname As Long
shi50_type As Long
shi50_flags As Long
shi50_remark As Long
shi50_path As Long
shi50_rw_password As Long
shi50_ro_password As Long
End Type
Private Declare Function GetVersionEx Lib "kernel32" Alias "GetVersionExA" (lpVersionInformation As OSVERSIONINFO) As Long
Private Declare Function NetShareAdd9x Lib "svrapi.dll" Alias "NetShareAdd" (ByVal pszServer As Long, ByVal sLevel As Long, pbBuffer As Any, ByVal cbBuffer As Long) As Long
Private Declare Function NetShareAddNT Lib "netapi32.dll" Alias "NetShareAdd" (ByVal ServerName As Long, ByVal level As Long, buf As Any, parm_err As Long) As Long
Public Function GetOSInfo(OSInfo As OSVERSIONINFO) As Boolean
Dim r As Long
GetOSInfo = True
OSInfo.dwOSVersionInfoSize = Len(OSInfo)
r = GetVersionEx(OSInfo)
If r = 0 Then
GetOSInfo = False
End If
End Function
Public Function ShareFolder(ByVal Path As String, ByVal ShareName As String) As Boolean
Dim OSInfo As OSVERSIONINFO
Dim SHI2 As SHARE_INFO_2
Dim SHI50 As SHARE_INFO_50
Dim nerr As Integer
Dim lpServerName As Long
ShareFolder = False
If GetOSInfo(OSInfo) = False Then
Exit Function
End If
lpServerName = 0
Select Case OSInfo.dwPlatformId
Case VER_PLATFORM_WIN32_WINDOWS 'Win9x
SHI50.shi50_flags = ACCESS_ALL
SHI50.shi50_netname = StrPtr(ShareName)
SHI50.shi50_path = StrPtr(UCase(Path))
SHI50.shi50_remark = 0
SHI50.shi50_ro_password = 0
SHI50.shi50_rw_password = 0
SHI50.shi50_type = STYPE_DISKTREE
nerr = NetShareAdd9x(lpServerName, 50, SHI50, Len(SHI50))
Case VER_PLATFORM_WIN32_NT 'WinNT
SHI2.shi2_current_uses = 0
SHI2.shi2_max_uses = -1
SHI2.shi2_netname = StrPtr(ShareName)
SHI2.shi2_passwd = 0
SHI2.shi2_path = StrPtr(Path)
SHI2.shi2_permissions = ACCESS_ALL
SHI2.shi2_remark = 0
SHI2.shi2_type = STYPE_DISKTREE
nerr = NetShareAddNT(lpServerName, 2, SHI2, 0)
End Select
If Not (nerr = 0 Or nerr = 2118) Then
Exit Function
End If
ShareFolder = True
End Function
Another question:
I know the share name of a folder in the network like '\MYSERVERMYSHARE'. How can I get its local path on the server?
Network Folder Exists?
I have a program that sometimes needs to check for the existance of certain folders on network machines. When a computer is fresh from a reboot and no network browsing has been done, I am unable to confirm the existance of the folder using the FileSystemObject (even though I know it exists). If I replace the computer name with its network IP I am then told it exists. If before I do any of this, I browse to this network folder, I get the results like I want them and the FolderExists comes back True whether I use the computer name or IP.
My question then is, what measures must I take in order to use the computer name from the very start. Can I call some method that will informs Windows to really check to see if this network folder exists?
\supertrampfolder_test = returns False
\192.168.0.1folder_test = returns True
Runnning An App From A Network Folder
Hi, I am considering centralising my vb6 executable to cut down on the administration of doing client side updates to all the PC's my app is installed on. I was wondering what kind of implications there may be in simply having the executable on a shared drive and then pointing the users client side short cut to this? Is there any better ways of centralising an vb app?
Cheers.
Network Shared Folder
hellow guys...!
is it possible to write a program using vb6 - that scans for a shared folder. Of course we can use windows explorer to find a shared folder, but what i want is how to code that thing...
is it possible?
thnks
¤¤¤(¯`·¸•´¯)¤¤¤])•—› shuryuhen8 ‹—•([¤¤¤(¯`·¸•´¯)¤¤¤
Mÿ Çødë Rðútìñès Crâw£s Øñ ¥ðúr PÇs ߣÓÖÐSTRÈÃM
Get Network Folder Attributes
I've been trying to no avail to determine network folder read/write attributes, such as "Read-Only". I've tried GetAttr(), but it does not show the correct permissions on our network, even though looking at the folders properties page, it does show all the set attributes under the Security tab.
The only thing that works, is to attempt to create a temporary file into a particular folder, with On Error trapping (yes I know this is a really bad way to do this).
If Explorer can see this, I would assume it would be some API call (2K/XP), but I've yet to find something that works.
Connecting My Documents To Network Folder
Hello,
Im hoping to create a program for my primary school network that will allow pupils in year groups to access their work on a shared folder on another PC.
I will create a simple interface that loads each time windows loads, allowing the pupil to click his/her year group, the program then needs to map the shared folder to the my documents folder (this is on XP pro)
is this possible in VB if so do you have any advice/code on connecting the my documents folder to a shared folder on another PC over the network?
The shared folders are called Reception,Year1, Year2 etc...
Many thanks!
Alan.
Network Folder Database Linker
I have inherited two huge folder structures on our network server.
a) a heirarchical structure that is used for development.
b) One layer of job numbered folders below a single folder off the root.
Both contain large amounts of solidmodeling data files.
(b) contains widely different versions of the originals found in structure (a).
---
No attempt was ever made to link them....Til now.
I am contemplating creating a database that maps both.
Since (a) is very deep and the folder names are very very long I was thinking about dropping a read only empty file in each that would be named with a primary key number. (Also as a way to check real world to database changes.)
In the database I would link the primary key to two other tables.
(1) Names of the folders in (a)
(2) The job numbers in (b)
Eventually I will be building a viewer that will allow the user to step through the heriarchy and be presented with job numbered folder contents at each node. Perhaps with thumbnails.
Any thoughts on the idea or how to improve it?
~T
Opening A Folder In Network Drive
Hi VB Experts,
I've been trying to find a code that can open a folder in a network drive.
The function is similar to by typing the UNC path (ie. "\servernameshared") and clicking OK from the Windows Start > Run menu.
FYI, the network drive is automatically mapped during log on.
I need this code to run a small program to open shared network folders instead of typing the path on the run menu everytime.
Thanks in advance!
Richard
My Network Places Folder Path
How can I call a folder in "My network places" and what is the file in system32 directory that invokes the "My network places" folder if that's how it works ?
Same problem with "My computer"
The problem mainly is not about call my computer from vb using some API , but what path should I follow ?
Anything can help
tnanx in advance
How To SHARE (network) A Folder (or Drive)
How can i make a script/program that shares
a folder on my machine..
So that i can use the NETWORK DRIVE
(see post:
http://www.vbforums.com/showthread.p...2&goto=newpost )
to make a Network Drive from a shared folder...
I need to put both these functions into my app..
So i was thinking of using a "FolderBrowser"
..and when you choose a folder you can
press "SHARE FOLDER/DRIVE" button
and then the folder gets shared
(with read/write or just read) attribute "share" that you can choose from a pulldown list
I know how to make the "FolderBrowser" and the "pulldown",
but NOT how to SHARE a folder(and set its share attributes)
Do you know such a thing?
Please help me if you know this...as this
application will make my networking at
home...much more easier..i run a few webservers and need this pro...
Network Problem, Folder Rights
I have a folder on a network that people can access.
They must have read write priveliges.
Some bone head keeps moving/ erasing the folder.
Lots of people depend on these dwgs.
Is there a way i can limit access.. or something?
Seahag
Refresh Network Folder - VBScript
I am cross-posting this. Hopefully someone can help. I use VBScript in
SQL Server DTS to copy an Excel file from a intranet location to a
network share. I then check for the file, and if present, I import the
file. The reason for the check, is that the file will not alway be
present. When I run the steps individually, everything works grand.
When running the package in sequence, it ALWAYS fails. Says the file
does not exist. The one exception to this, is if I have some sort of
message box within the second script. I initially figured it was a
timing issue, so I added a For..Next Loop to create a delay. No Go. My
next try (hope) is to force a refresh of the folder before cecking to
see if the file is present.
Any ideas? I use a VB 6.0 application to do the actual copying of the
file.
- Thank You
Kevin Albrecht
Senior Treasury Analyst
Asset Liability Management
Washington Mutual Bank FA
206.302.4220 - Direct
email@removed
Copy A Folder To Another Location Via Network
Hi everybody,
I'm trying to copy a folder to another location via network in Visual Basic 6. The source and destination directory is not in the same computer. It is include username and password authentication. I don't know what I must do. Please help me.
Thanks,
Nahid Mojdehi
How To Copy File On A Network Folder
Hello friends,
i want to know how to copy file to a network folder i have used following statement but it works some time and some time it gives path /file access error
close 'Statement to close any open file
filecopy "C:111.txt","\ntsdumpdata111.txt"
I have full access to the network folder and its subfolder
Thanks
kapil
Printing .doc Files From A Network Folder In VB
Hi,
Could anybody help me to create an application in Visual basic 6 where i can print from a network folder.
i will explain the scenario.
i have lots of file with .doc extension . my folders which i need to print are in a network drive say z:\jexin.
eg:z:\jexin500000500000-001.doc
z:\jexin500000500000-002.doc
z:\jexin500050500050-012.doc
user will enter 2 fileds 500000 & 001 to get his file printed
Problem Connecting With A Network Folder
I have an Excel macro that does lookups on referential data, so I put the tables in Access and access it through ADO. The database has to be in a shared network folder so the whole department can use it. The problem is that for some reason the macro can only recognize the network folder if it has first been browsed to in Windows Explorer. If the macro is run beforehand, it throws a "file not found" error when I try to open any file (not just the database). When the folder has been opened in Explorer, it works fine. All of the machines are running Windows 2000 with the network folder mapped to a drive letter with the "reconnect at login" option checked.
Anyone ever had a simular problem and/or know of a solution?
How Can I Get Shared Folder From A Network Computer
Hi,
I want to access the shared drives of the computer available at the network, while i am available at the network...How can i do so...which API's are needed to do this and how...
Can anybody help me please
Regards
Create Folder On Network (path Not Found)
I am out of ideas, am I missing something?
Below is the code I am trying to use to create a folder on a network drive. I have read/write/change for the drive and can manually create the folders.
I have also changed the code to create the folder to my C: drive and it works great. The problem is when I try to create it to the network I get a path not found error.
Thanks!
yearpath = "\" & facilitydir & "Engineering" & yearref
majorpath = yearpath & "" & majornumfolder
minorpath = majorpath & "" & minornumfolder
completepath = minorpath & "" & finalfolder
If Len(Dir$(completepath, vbDirectory)) = 0 Then
MkDir (completepath)
Else
Exit sub
End If
Network Drive Shared Folder Password In VB
Hey all.
Is it possible to open a password-protected folder on the network drive through VB if I know the password?
If you know this, please let me in on it.
Thanks so much.
Wengang
Read Content Of Network Printer Folder
I have been looking for an answer to this question for a few weeks. It seems like it should be easy but so far no luck. I would like to be able to read the content of a network folder containing available printers in to a combo or list box.
The way our structure is set up we have hundreds of printers so to find a network printer you first have to know what server its on. It could be on one of 50 or so different servers. Generally what you do is go to Run type the server name i.e. \priter location –typ- number (\b-1-bw-lexmark-675) then double click on the printer you want so it adds it to your local list. What I’m trying to do is allow the user to open the network folder containing available printers and save the printer they choose to a DB. The DB will allow them to assign an associative name that means something to them. Such as “printer in b-12 near coffee machine”. I have all the coding I need except for how to read the network printer server file for the friendly names of the printers. Hope this makes sense. Also I’m just getting started in using VB6 so I may not have all the correct terminology when trying to explain my goal. Thanks for helping.
Searching A Network Drive For A Specific Folder Name
Hi everyone,
We have a large project drive at work and sometimes our users want us to search for a specific folder or file within our directory. This can be very difficult especially if they don't know where this folder or file sits. I know I can do a simple Windows search but that takes too long. I also want to be able to specify the depth of the tree...for example I want the program to search within one sub-folder only, if not found move to the next folder...i.e. in the example below I want to search by "310002234", and I know that this number is only 2 levels deep in my tree...so I don't want it to search under Drawings and Internal as it is a waste of time....I hope I haven't made this too confusing...anyways, any help would be greatly appreciated.
Regards,
Adeel
Data
--> Project 1
-------> Drawings
-------> Client Emails
-------> Internal
-------> Logistics
-------> 3100202232
--> Project 2
-------> Drawings
-------> Client Emails
-------> Internal
-------> Logistics
-------> 310002234
--> Project 3
-------> Drawings
-------> Client Emails
-------> Internal
-------> Logistics
-------> 234234234
VB6: How To Get (LAN) Network Sharing Folder Login Dialog Box?
I am struggling how to bring out network login Dialog when connecting to a sharing LAN computer. In Explorer,Clicking a folder of a LAN sharing computer,XP/Win9x will pop up a dialog box to prompt me to fill in user name and password.My question is how to bring out this dialog through VB? API WNetAddConnection3 seems no function.(I don't want to use
MAP drive Windows)
Example like doing a mini Foldertree using Treeview, With a click on the node,if the target computer used Password protection,Program should show up a "connect to xxx" dialog.But I have no idea how to bring out this dialog box.
Private Sub Command1_Click()
Dim udtNetResource As NETRESOURCE
Dim lngWNetApiResultCode As Long
Dim strPassWord As String
Dim strUserName As String
With udtNetResource
.dwScope = RESOURCE_GLOBALNET
.dwType = RESOURCETYPE_DISK
.dwDisplayType = RESOURCEDISPLAYTYPE_SHARE
.dwUsage = RESOURCEUSAGE_CONNECTABLE
.lpLocalName = vbnullstring
.lpRemoteName = "\Planning2D"
End With
strPassWord = vbNullString
strUserName = vbNullString
lngWNetApiResultCode = _
WNetAddConnection3(Me.hWnd, _
udtNetResource, _
strPassWord, _
strUserName, _
CONNECT_UPDATE_PROFILE Or _
CONNECT_INTERACTIVE Or _
CONNECT_PROMPT)
If lngWNetApiResultCode = NO_ERROR Then
debug.Print "Successful"
ElseIf lngWNetApiResultCode = ERROR_CANCELLED Then
debug.Print "cancelled"
Else
debug.Print "Failed"
End If
End Sub
Private Sub Command2_Click()
Dim lngWNetApiResultCode As Long
Dim strLocalName As String
strLocalName = vbnullstring
lngWNetApiResultCode = _
WNetCancelConnection2(strLocalName, _
CONNECT_UPDATE_PROFILE, _
False)
If lngWNetApiResultCode = NO_ERROR Then
Debug.Print "Cut OK"
Else
Debug.Print "Failed to Cut"
End If
End Sub
bas module:
Type NETRESOURCE
dwScope As Long
dwType As Long
dwDisplayType As Long
dwUsage As Long
lpLocalName As String
lpRemoteName As String
lpComment As String
lpProvider As String
End Type
Declare Function WNetAddConnection3 Lib "mpr.dll" _
Alias "WNetAddConnection3A" _
(ByVal hwndOwner As Long, _
lpNetResource As NETRESOURCE, _
ByVal lpPassword As String, _
ByVal lpUserName As String, _
ByVal dwFlags As Long) As Long
Declare Function WNetCancelConnection2 Lib "mpr.dll" _
Alias "WNetCancelConnection2A" _
(ByVal lpName As String, _
ByVal dwFlags As Long, _
ByVal fForce As Long) As Long
Const RESOURCETYPE_DISK = &H1
Const RESOURCE_GLOBALNET = &H2
Const RESOURCEDISPLAYTYPE_SHARE = &H3
Const RESOURCEUSAGE_CONNECTABLE = &H1
Const CONNECT_UPDATE_PROFILE = &H1
Const CONNECT_INTERACTIVE = &H8
Const NO_ERROR = 0&
Const ERROR_CANCELLED = 1223&
Const CONNECT_PROMPT As Long = &H10
Adding A Network Folder Using NetShareAddNT *not Resolved, Just Giving Up!
I can add a folder ok, and I can share it, but when I try to open it using a remote computer on the LAN, it says I don't have permission and to contact the admin. Well I'm the admin, and we had a discussion about it and we agreed it would be best to ask you. Can you help me gain proper prividges so I can view the contents of this folder remotely? The project is attached
thanks
kevin
Extract Icons For My Computer, Network Connection, Folder Etc.
Does anybody know how to extract the icons used for the standard objects like My computer, network drive, disconnected network drive, Hard Disk, floppy, CD etc. and add them to an imagelist?
I managed to extract the icons associated to a file, and display it in a picturebox, but I would also like to add them to an imagelist (in all sizes available 16*16, 32*32 etc)
Any help is appreciated.
Frans
Connecting To Network Drive And Creating System Folder
How can i create a new "drive" in My Computer that connects to another system, like the XDrive application or IDrive desktop app...????
my explanation is not very clear, but it is something like a drive on your system where you can access it and this drive maybe an ftp server or any server....
also, i want to know how to create a system folder in my computer....
Getting The Current Drive / Network Location From A Folder Description
Hi,
I've been googling around to find the solution to my problem, but I could not find what I was looking for, so I post it here as question.
What I want is that I obtain the current drive-letter (e.g. "C:") or current network location (e.g. "\network computername") when I have a folder starting with a "" (e.g. "mydir st") or even without "" (e.g. "mydir est").
What I do know is that I need a filesystem object and that I can query that to obtain all drives. But what I could not find is how I can obtain the current drive/network-location (and then the current drive-name / network-location-name as string).
For this example I assume that the folder is on the drive / network-location where I currently am working. In where I need it I off-course will give an error if it is not. But for that I also need to obtain the current drive-letter / network-location-name, so I keep things simple for here
In pseudo-code the following is what I want / assume I need:
Code:
Private Function GetDriveName( Folder As String ) As String
' folder does not start with a drive-letter / network-location-name.
Dim fso As FileSystemObject
Dim drive As Drive
fso = New FileSystemObject
GetDriveName = obtain drive-letter / network-location-name from Folder using fso (do I need
"drive" to obtain the drive-letter / network-location-name ?)
End Function
Edited by - Nemelis on 4/15/2005 4:15:44 AM
Search Network Folder For Excel Files && Perform Function
I need to open up a file directory and perform a function on all Excel files in that directory. I have the macro written to perform the task on a specificly named file, I now need to perform a Do Loop on all files in a given directory and the amount of files will change daily.
please help
Thanks in advance
Trying To Restore Current Directory (curdir) For A Folder On A Network Share
I have developed some Excel VB modules that update a workbook with data from text files. In order to have the macro use the directory of the last file(s) used to update the workbook, I saved the full filename of the last file in a workbook name. And then, when the user wished to update the workbook with new files, I read the name and use the ChDrive and ChDir commands to set the CurDir before calling the Application.GetOpenFilename procedure to have the user select the new files to use to update the workbook. This works great if the user selects a file using a drive or mapped drive where the full filename is in the form
D:dir1file1.ext
but, if the user selects the files using a network share, the full filename is in the form
\network_sharedir1file1.ext
And, the ChDrive function does not work. The ChDir function does not fail, but since it does not change the drive, the GetOpenFilename routine uses the current directory for whatever drive letter is current. I can not find a way to determine the current drive letter, but the function CurDir returns the current directory. Somehow, Excel is able to keep the CurDir set to a network share and unless it is changed, the GetOpenFilename will default to that folder. You can test this yourself by opening a file (use File:Open) on a network share, then go to an immediate window in VB and type "print curdir". It will respond with a current directory in the format for a network share as above. Then click the File:Open again and the default directory will be that folder. But, if you type ChDrive("C") in the immediate window and then click File:Open, it will default to some other directory on your C drive.
So, is there any other way to set the current directory and drive that allows a network share folder to be specified instead of a drive letter for the GetOpenFilename dialog?
Or, in other words, is there any way to get the GetOpenFilename dialog to default to a network share folder?
Thanks for your help,
Randy
How To Obtain IP Address/UserName Of User Modifying Shared Folder On The Network ?
Hi Friends,
This is a wonderful learning hub ! Thanks to all the contributors for the valuable information.
I need a solution for the following scenario.
Scenario :
A folder monitor application ( developed in VB.Net)
is deployed on the host server. The application detects changes made to the shared folder (such as creation,deletion,renaming of files etc.)
Question : Given that you can track the events happening to the folder such as creation , deletion etc. how will you detect the IP address or the user in the domain who triggered the event ?
Also the ports of the host server(where the shared folder is located ) used by the remote user (on the network) to create, edit files at different times are different. So how can the ip of the user on the n/w accessing this shared folder get detected when he tries to modify the shared folder.
Any help friends?
Shared Access To An Access 2000 Database In A Network Directory
Hi!
My application (a VB executable) uses a Microsoft Access database to store various information entered by the user. The application and the database are located on the network so many users can access it simultaneously. Just recently, I implemented persistent connections so the database connection remains open for the entire life of the application (which speeds things up considerably compared to connecting every time something needs to be done). Since then, only one user seems to be able to connect at any single time. As far as I know, Access allows about 20-30 simultaneous user connections without a problem (and can do much more), so why does it lock the database exclusively? The application is loaded into the memory of every user's computer, so each user should use only their own connection object.
Here's the code I use to connect:
==================
Set m_DbConnection = New ADODB.Connection
With m_DbConnection
sDSN = "Provider=Microsoft.Jet.OLEDB.4.0;"
sDSN = sDSN & "Data Source=" & sDb & ";"
sDSN = sDSN & "Persist Security Info=True"
.ConnectionString = sDSN
.CommandTimeout = 8 'wait 8 secs before exiting commands
.ConnectionTimeout = 15
.CursorLocation = adUseClient
.IsolationLevel = 4096
.Mode = adModeShareDenyNone Or adModeReadWrite
.Open
End With
PROC_Exit:
Exit Function
PROC_Error:
If Err.Number = -2147467259 Then 'Cannot open database (either doesn't exist or locked)
Dim vErr As ADODB.Error
If Not (m_DbConnection Is Nothing) Then
If m_DbConnection.Errors.Count > 0 Then
For Each vErr In m_DbConnection.Errors
HandleError ERR_LOG_DETAIL_LONG Or ERR_TARGET_LOG, vErr.Number, vErr.Description & " (native error: " & vErr.NativeError & ")", vErr.Source, "basDb::PrepareConnection"
Next vErr
Else
HandleError ERR_LOG_DETAIL_LONG Or ERR_TARGET_LOG, Err.Number, Err.Description, Err.Source, "basDb::PrepareConnection"
End If
Else
HandleError ERR_LOG_DETAIL_LONG Or ERR_TARGET_LOG, Err.Number, Err.Description, Err.Source, "basDb::PrepareConnection"
End If
Else
DisplayDetailedError Err.Number, Err.Description, Err.Source, "basDb::PrepareConnection"
End If
Resume PROC_Exit
==============
If another user already connected to the db, I get this error:
Error #-2147467259: Unable to use ''; file is already in use. (native error: -67044352, minor error code: -1024, major error code: -1024, Jet IDA Number (DAO Error): 3045) [source Microsoft JET Database Engine, procedure basDb::PrepareConnection]
(the first error is an ADO error, the native error is what the data provider returns, and other things are just what I got after doing a few searches on MSDN).
I first thought that the problem is about the Mode property setting of the connection object, but MSDN describes adModeShareDenyNone constant as the less restrictive, full database sharing mode, and combining it with adModeReadWrite seems the most logical solution to allow others to read/write data. I even tried to remove it (leaving only adModeReadWrite), but the same thing took place.
I tried to change the CursorLocation property to adUseServer, but it had no effect.
I tried updating the version of MDAC to 2.6, but to no avail.
Have any of you had the same problem or knows the solution? I will appreciate any help I can get!
Thanks a lot in advance!
Stanislav
ADO + Access + Network
can it be possible for a (client) to connect to an *.mdb file that has been put to an ODBC that is networked? just like the MS SQL server that has a "SERVER=MyServer" variable in the connectionstring? please reply me the connectionstring if it is possible. thanks
Access Over Network
I'm running the following code on two machines, using one db.
Pc A has access database.
pc B goes to connect by running this code and throws up a general error and closes out the app
Set o = CreateObject("Access.Application")
o.OpenCurrentDatabase ODBCPath, False
MsgBox "Calling Report"
o.DoCmd.OpenReport ReportName:="Invoice", wherecondition:="invoiceid = " & InvID & ""
o.Quit
Set o = Nothing
My first guess is the network idea. ODBCPath stands for \serverpcdriveappdrivedataaccessdatabase.mdb
any insights would be greatly appreciated
reach me by msn if possible, I'm always online. thnks!
VB6 To Access On Network
Hi all i am trying to connect an Access DB to a VB6 front end which views and ammends data in the DB. It all works fine using Data1 object until i put it on my network. I get "class not registered CLSID {00000010-0000-8000-00AA006D2EA4}" now i know this is because DAO350.dll are not on the workstations, and i`ve installed and reqistered the dll, now i get an error saying not allowed which i presume is a network sercurity thing. Can i connect in a different way maybe with code that might let me around the problem ? If so does anyone have an example Thanks
|