Solved

Visual basic Question??

Posted on 1998-05-30
3
182 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 Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

A theme is a collection of property settings that allow you to define the look of pages and controls, and then apply the look consistently across pages in an application. Themes can be made up of a set of elements: skins, style sheets, images, and o…
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
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…

734 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