ALLInterview.com :: Home Page KalAajKal.com
 Advertise your Business Here     
Browse  |   Placement Papers  |   Company  |   Code Snippets  |   Certifications  |   Visa Questions
Post Question  |   Post Answer  |   My Panel  |   Search  |   Articles  |   Topics  |   ERRORS new
   Refer this Site  Refer This Site to Your Friends  Site Map  Bookmark this Site  Set it as your HomePage  Contact Us     Login  |  Sign Up                      
tip       Ask Questions on ANYTHING, that arise in your Daily Life at     FORUM9.COM
Google
 
Categories  >>  Software  >>  Microsoft Related  >>  Visual Basic
 
 


 

 
 Visual Basic interview questions  Visual Basic Interview Questions
 C Sharp interview questions  C Sharp Interview Questions
 ASP.NET interview questions  ASP.NET Interview Questions
 VB.NET interview questions  VB.NET Interview Questions
 COM+ interview questions  COM+ Interview Questions
 ADO.NET interview questions  ADO.NET Interview Questions
 IIS interview questions  IIS Interview Questions
 MTS interview questions  MTS Interview Questions
 Crystal Reports interview questions  Crystal Reports Interview Questions
 BizTalk interview questions  BizTalk Interview Questions
 Dot Net interview questions  Dot Net Interview Questions
 Exchange Server interview questions  Exchange Server Interview Questions
 SharePoint interview questions  SharePoint Interview Questions
 Microsoft Related AllOther interview questions  Microsoft Related AllOther Interview Questions
Question
CRETE A BACKUP FILE
 Question Submitted By :: Charm_nirmal1988
I also faced this Question!!     Rank Answer Posted By  
 
  Re: CRETE A BACKUP FILE
Answer
# 1
Open a project which have one text box name as 'txtbackup' &
one command button name as 'cmdBackup'. After that, put the
following code for Back up the file which is present in that
current folder with the name sample.mdb 



Dim obj As Object
Dim path As String
Dim j As Integer
Dim b As String
Dim a(100) As String
Dim i As Integer


If txtbackup <> "" Then
'******************************************
Dim c, c1 As String
i = 0
c = txtbackup.Text
For j = 1 To Len(c)
c1 = Mid(c, j, 1)
If c1 <> "\" Then
 a(i) = a(i) & c1
Else
 i = i + 1
End If
Next
'*******************************************

Set obj = CreateObject("Scripting.FileSystemObject")
path = txtbackup.Text
b = a(0)

'**** Folder Creation ****

Dim fso As New FileSystemObject
For j = 1 To i
 b = b & "\" & a(j)
 If Not fso.FolderExists(b) Then
  obj.CreateFolder (b)
 End If
Next

'**** File Creation ****

If Not fso.FileExists(path & "\sample_" & Format$(Date,
"dd_mm_yy") & ".mdb") Then
 obj.CopyFile "" & App.path & "\sample.mdb", "" & path &
"\sample_" & Format$(Date, "dd_mm_yy") & ".mdb"
 MsgBox "Data Base Successfuly Back Up in Loction :" & path
& " ", vbInformation, "Back Up"
Else
 If MsgBox("Data Base is already exists. Do u want to
replace it?", vbQuestion + vbYesNo, "Confirmation") = vbYes Then
  obj.CopyFile "" & App.path & "\sample.mdb", "" & path &
"\sample_" & Format$(Date, "dd_mm_yy") & ".mdb"
  MsgBox "Data Base Successfuly Back Up in Loction :" & path
& " ", vbInformation, "Back Up"
 End If
End If


Else
 MsgBox "Enter the Destination Path.....", vbExclamation
 
End If

txtbackup.Text = ""
txtbackup.SetFocus
End Sub

 
Is This Answer Correct ?    4 Yes 0 No
Haiipl25
 

 
 
 
Other Visual Basic Interview Questions
 
  Question Asked @ Answers
 
What is the difference between Exec and ExecSQL? (wouldnt this be dependent on data access? Ie ADO use different method than DAO)  1
What is the error message that you would get if you try to assign "Null" to an integer variable? Symphony2
How can we call Stored procedure of Back End in RDO and ADO ?  1
What is the default property of data control?  1
What is the statement to extract 4 characters from the middle of a string?  1
Why we use Treeview Control?  1
What are the new events in textbox that has been included in VB6.0  1
wat is excel Kingfisher2
how many no of controls in form? Airex-Logistics15
What is Friend Variable?  1
Why is it not good to use a variant data type?  2
I want to develop a stand alone application which can communicate with the existing applications in the system. On which this application should be based on: Standard Exe, Active-X Exe, Active-X Dll.  2
What is the difference between COM and DCOM? Microsoft3
what is the Default property of datacontrol ?  2
What are the types of API Types?  1
What is the size of the variant data type?  2
How to get Cursor position using API?  2
What are the different types of errors in visual Basic? ABC3
How can you save and Get data from Clipboard?  1
What are the differences between a standard module and a class module?  4
 
For more Visual Basic Interview Questions Click Here 
 
 
 
 
 
   
Copyright Policy  |  Terms of Service  |  Help  |  Site Map 1  |  Articles  |  Site Map  |   Site Map  |  Contact Us interview questions urls   External Links 
   
Copyright © 2007  ALLInterview.com.  All Rights Reserved.

ALLInterview.com   ::  Forum9.com   ::  KalAajKal.com