Solved

Visual basic Question??

Posted on 1998-05-30
3
176 Views
Last Modified: 2013-11-25
We have "Temp" variable that has "C:hlrs\hrlslog.log" string.
      It empty in the beggining.
      When we install back-end(Visual basic program) we will specify where we want our data( which comes from
      the Access Database)to be copied to. Right now , we are using drive, dir list controls to specify destination
      point.But, now the client want us to use Universal Naming convention. The person when install the software will
      choose the server desination(UNC) from the list box
      and then the programm will copy automatically the 'Test' variable with the decomposed data to UNC +
      filename string.
      Any suggestions????????
I was thinking about WNetAddConnection API Call, but I don't know how it works.Does anybody has a code???    
0
Comment
Question by:gima
3 Comments
 
LVL 4

Expert Comment

by:trkcorp
ID: 1462119
Does anyone speak English?
0
 
LVL 4

Expert Comment

by:zsi
ID: 1462120
trkcorp,

Please be a little more sensitive to the fact that not everyone here speaks the same language as you.  This is the Internet, after all.

Besides, before you go off criticising people's English, you might want to brush up on your own grammer skills. :)
0
 
LVL 5

Accepted Solution

by:
bin_huwairib earned 40 total points
ID: 1462121
gima,

Try this code:

Private Declare Function WNetAddConnection Lib "mpr.dll" Alias "WNetAddConnectionA" (ByVal lpszNetPath As String, ByVal lpszPassword As String, ByVal lpszLocalName As String) As Long
Private Declare Function WNetCancelConnection Lib "mpr.dll" Alias "WNetCancelConnectionA" (ByVal lpszName As String, ByVal bForce As Long) As Long

Private Sub Command1_Click()
 'To add the connection supply the following info. correctly:
 '1- A valid server and sharename is your network organization.
 '2- Your password that provide permission to the resource.
 '3- Local name.

 Call WNetAddConnection("\\dpcnt7\share", "dpcadmin2", "Y:")
End Sub

Private Sub Command2_Click()
 'To cancel a network connection
 Call WNetCancelConnection("Y:", 0)
End Sub


Best regards
Bin Huwairib
0

Featured Post

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

758 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now