Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Visual basic Question??

Posted on 1998-05-30
3
Medium Priority
?
188 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 80 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

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
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…

879 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