Click here to Skip to main content
15,915,764 members
Home / Discussions / Visual Basic
   

Visual Basic

 
Questionemail application in vb without the use of MAPI controls Pin
K Suresh Nair3-Mar-11 1:09
K Suresh Nair3-Mar-11 1:09 
AnswerRe: email application in vb without the use of MAPI controls Pin
Richard MacCutchan3-Mar-11 2:20
mveRichard MacCutchan3-Mar-11 2:20 
GeneralRe: email application in vb without the use of MAPI controls Pin
K Suresh Nair3-Mar-11 3:18
K Suresh Nair3-Mar-11 3:18 
GeneralRe: email application in vb without the use of MAPI controls Pin
Richard MacCutchan3-Mar-11 3:23
mveRichard MacCutchan3-Mar-11 3:23 
AnswerRe: email application in vb without the use of MAPI controls Pin
_Erik_3-Mar-11 2:30
_Erik_3-Mar-11 2:30 
AnswerRe: email application in vb without the use of MAPI controls Pin
Simon_Whale3-Mar-11 2:57
Simon_Whale3-Mar-11 2:57 
GeneralRe: email application in vb without the use of MAPI controls Pin
K Suresh Nair3-Mar-11 3:12
K Suresh Nair3-Mar-11 3:12 
QuestionVisual Basic: Do Until i = 1 To LastFolderFound - Adding a new record Number Pin
Memphis761-Mar-11 22:59
Memphis761-Mar-11 22:59 
Hi there,

I'm been searching the net for an answer but I couldn't really get it and/or understand it Frown | :(
What I'm trying to accomplish is to Search my drives for the Folder's Name - and Add it to an MS Access Table
So far I have done that and works fine.
Now What I want to do is to add a Unique record ID number.(I don't want to use the auto-number function, because I'm deleting all the records every time I run the SearchFolders() and the auto-number kips incrementing otherwise)
I know this is done with the Do Until i = 1 + (Last Folder Found)
where I am lost is in the "Last folder found" I'm not sure what to reference there and also where to add it onto my code
Please take a look and help me out!

<br />
Private Sub SearchFolders(ByVal strDIR As String)<br />
Dim adoCON As New ADODB.Connection, adoRST As New ADODB.Recordset, objFSO As New FileSystemObject<br />
Dim FolderName, FolderPath, FolderDate, FolderLMod, FolderLAcc, FolderSize<br />
Dim fFolder As Folder, sFolder As Folder, i As Integer<br />
    Set fFolder = objFSO.GetFolder(strDIR)<br />
    For Each sFolder In fFolder.SubFolders<br />
        ' Search Recursively<br />
        SearchFolders sFolder.Path<br />
        ' Get Folder Path<br />
        FolderPath = sFolder.Path<br />
        ' get Folder Name<br />
        FolderName = objFSO.GetFolder(sFolder).Name<br />
        ' Get Folder Date Created<br />
        FolderDate = objFSO.GetFolder(sFolder).DateCreated<br />
        ' Get Folder Last Date Modified<br />
        FolderLMod = objFSO.GetFolder(sFolder).DateLastModified<br />
        ' Get Folder Last Date Accessed<br />
        FolderLAcc = objFSO.GetFolder(sFolder).DateLastAccessed<br />
        ' Get Folder Size<br />
        FolderSize = objFSO.GetFolder(sFolder).Size<br />
        <br />
        Set adoCON = CurrentProject.Connection<br />
        adoRST.Open "SELECT * FROM FoldersPath", adoCON, adOpenKeyset, adLockOptimistic<br />
        With adoRST<br />
            .AddNew<br />
            !FolderID = i<br />
            !CreatedOn = Now()<br />
            !CreatedBy = Environ("UserName")<br />
            !FolderName = FolderName<br />
            !FolderPath = FolderPath<br />
            !FolderSize = FolderSize<br />
            !DateCreated = FolderDate<br />
            !DateLastAccessed = FolderLAcc<br />
            !DateLastModified = FolderLMod<br />
            .Update<br />
        End With<br />
        adoRST.Close<br />
        adoCON.Close<br />
        Set adoRST = Nothing<br />
        Set adoCON = Nothing<br />
    Next<br />
    Set objFSO = Nothing<br />
    Set fFolder = Nothing<br />
    Set sFolder = Nothing<br />
End sub<br />

AnswerRe: Visual Basic: Do Until i = 1 To LastFolderFound - Adding a new record Number [modified] Pin
_Erik_1-Mar-11 23:26
_Erik_1-Mar-11 23:26 
GeneralRe: Visual Basic: Do Until i = 1 To LastFolderFound - Adding a new record Number Pin
Memphis762-Mar-11 6:24
Memphis762-Mar-11 6:24 
GeneralRe: Visual Basic: Do Until i = 1 To LastFolderFound - Adding a new record Number Pin
Memphis762-Mar-11 14:02
Memphis762-Mar-11 14:02 
GeneralRe: Visual Basic: Do Until i = 1 To LastFolderFound - Adding a new record Number Pin
_Erik_3-Mar-11 0:32
_Erik_3-Mar-11 0:32 
AnswerRe: Visual Basic: Do Until i = 1 To LastFolderFound - Adding a new record Number Pin
Luc Pattyn2-Mar-11 1:39
sitebuilderLuc Pattyn2-Mar-11 1:39 
GeneralRe: Visual Basic: Do Until i = 1 To LastFolderFound - Adding a new record Number Pin
Memphis762-Mar-11 6:25
Memphis762-Mar-11 6:25 
GeneralRe: Visual Basic: Do Until i = 1 To LastFolderFound - Adding a new record Number Pin
Luc Pattyn2-Mar-11 6:29
sitebuilderLuc Pattyn2-Mar-11 6:29 
AnswerRe: Visual Basic: Do Until i = 1 To LastFolderFound - Adding a new record Number Pin
Dave Kreskowiak2-Mar-11 9:28
mveDave Kreskowiak2-Mar-11 9:28 
GeneralRe: Visual Basic: Do Until i = 1 To LastFolderFound - Adding a new record Number Pin
Memphis762-Mar-11 12:05
Memphis762-Mar-11 12:05 
QuestionBIFF7 Conversion Pin
Dominick Marciano1-Mar-11 10:13
professionalDominick Marciano1-Mar-11 10:13 
AnswerRe: BIFF7 Conversion Pin
Dave Kreskowiak1-Mar-11 15:11
mveDave Kreskowiak1-Mar-11 15:11 
GeneralRe: BIFF7 Conversion Pin
Thomas Krojer1-Mar-11 21:23
Thomas Krojer1-Mar-11 21:23 
QuestionIntercept e Send ALT+F1 Pin
starcomsis1-Mar-11 5:24
starcomsis1-Mar-11 5:24 
AnswerRe: Intercept e Send ALT+F1 Pin
Dave Kreskowiak1-Mar-11 8:58
mveDave Kreskowiak1-Mar-11 8:58 
GeneralRe: Intercept e Send ALT+F1 Pin
starcomsis1-Mar-11 9:20
starcomsis1-Mar-11 9:20 
GeneralRe: Intercept e Send ALT+F1 Pin
Dave Kreskowiak1-Mar-11 14:46
mveDave Kreskowiak1-Mar-11 14:46 
QuestionHow to set parallel port in VB programming? Pin
saathis1-Mar-11 4:22
saathis1-Mar-11 4:22 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.