Solved

Visual basic Question??

Posted on 1998-05-30
3
184 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Free Backup Tool for VMware and Hyper-V

Restore full virtual machine or individual guest files from 19 common file systems directly from the backup file. Schedule VM backups with PowerShell scripts. Set desired time, lean back and let the script to notify you via email upon completion.  

Question has a verified solution.

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

The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
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…
Suggested Courses
Course of the Month6 days, 12 hours left to enroll

623 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