I have developed this macro as below. It will save directory with the addition of current year & month to folder "Year". However, what changes would I need to make to actually change sub directories to year, then month; for example, C:\Year\current year\current month' (with current year & month being updated automatically)?
' On Error Resume Next
Dim newPath As String
newPath = "C:Year_" & Format(Date, "yyyy-month") & ""
If (Err.Number) Then
Call MkDir(newPath)
' Now clear the error
Call Err.Clear
End If
End Sub
SOURCE: active directory
you can use in built ntbackup utility.
In a DC, in the Items to backup window, expand Mycomputer and you can see System state. select that and proceed. It will take the Active Directory data.
SOURCE: vb 6.0 ado connection without ado control moving next record
I see 2 problems with your code.
1) Each time you call cmdnext_Click, you're reopening the database. Each time you do that, you start at the beginning of the file. You need to have the database opened once, somewhere else in your program. Be sure that the record set is visible from this sub.
2) In order to use the "Next" function, you need a loop like this
'test for no records
IF REC.BOF and REC.EOF then
msgbox "No Records Found"
exit sub
end if
IF NOT REC.EOF then
REC.MoveNext
(display your fields)
END IF
Again, this will only work if your database is opened outside of the cmdNext_Click routine.
SOURCE: Use vb.net and access
Imports System
Imports System.IO
Imports System.Data
Public Class SaveImage
Shared Sub main()
Dim o As System.IO.FileStream
Dim r As StreamReader
Dim gifFile As String
Console.Write("Enter a Valid .Gif file path")
gifFile = Console.ReadLine
If Dir(gifFile) = "" Then
Console.Write("Invalid File Path")
Exit Sub
End If
o = New FileStream(gifFile, FileMode.Open, FileAccess.Read, FileShare.Read)
r = New StreamReader(o)
Try
Dim FileByteArray(o.Length - 1) As Byte
o.Read(FileByteArray, 0, o.Length)
Dim Con As New _ System.Data.OleDb.OleDbConnection("Provider=Microsoft.Jet.OLEDB.3.51;Persist Security Info=False;Data
Source=Test.mdb")
Dim Sql As String = "INSERT INTO images (Pic,FileSize) VALUES (?,?)"
Dim Cmd As New System.Data.OleDb.OleDbCommand(Sql, Con)
Cmd.Parameters.Add("@Pic", System.Data.OleDb.OleDbType.Binary, o.Length).Value = FileByteArray
Cmd.Parameters.Add("@FileSize", System.Data.OleDb.OleDbType.VarChar, 100).Value = o.Length
Con.Open()
Cmd.ExecuteNonQuery()
Con.Close()
Catch ex As Exception
Console.Write(ex.ToString)
End Try
End Sub
End Class
SOURCE: how to take active directory backup?
hi,welcome to fixya
ok i just checked it out and what i got for u is that u can try and go to this website and check it out,
http://www.backupassist.com/adwords/server-backup.html?gclid=CLKuk4bB4ZgCFZgtpAodo3ePDw
OR go to this website and check it out and this might be helpful for u,
http://www.microsoft.com/technet/prodtechnol/windows2000serv/reskit/distrib/dsbj_brr_axal.mspx?mfr=true
OR try this out
http://www.microsoft.com/technet/prodtechnol/windows2000serv/reskit/distrib/dsbj_brr_ixwo.mspx?mfr=true
pls rate this solution.......thanks
SOURCE: write into excel format
Your code does not save in access format it just makes a copy of existing file. You need to open table by table and export data using csv format.
It can be done using access OLE to export, or
write some VB code to access the database tables via ODBC and save row data to csv file
146 views
Usually answered in minutes!
×