Click here to Skip to main content
15,887,350 members
Home / Discussions / Visual Basic
   

Visual Basic

 
AnswerRe: Encrypting passwords in a database Pin
andyharman23-May-07 6:14
professionalandyharman23-May-07 6:14 
AnswerRe: Encrypting passwords in a database Pin
Dave Kreskowiak23-May-07 6:27
mveDave Kreskowiak23-May-07 6:27 
AnswerRe: Encrypting passwords in a database Pin
kubben23-May-07 7:00
kubben23-May-07 7:00 
QuestionCounting Records added and modified in a DataSet Pin
Quecumber25623-May-07 5:20
Quecumber25623-May-07 5:20 
AnswerRe: Counting Records added and modified in a DataSet Pin
Dave Kreskowiak23-May-07 6:19
mveDave Kreskowiak23-May-07 6:19 
GeneralRe: Counting Records added and modified in a DataSet Pin
Quecumber25623-May-07 6:51
Quecumber25623-May-07 6:51 
GeneralRe: Counting Records added and modified in a DataSet Pin
Dave Kreskowiak23-May-07 6:55
mveDave Kreskowiak23-May-07 6:55 
Questionpull data from access database table to vb.net Pin
jds120723-May-07 3:56
jds120723-May-07 3:56 
I have two functions. The first function search the directory for specific file extensions. I have a folder browser to browse to the folder in which I want to search for the files. The path is displayed into textbox1. Whatever file extension I type into textbox2, the filename with that extension will be added to listbox1.

Here is the code:

Private Sub GetDirectoryContents(ByVal dirs() As String, ByVal patterns() As String)<br />
        'Declare variable.<br />
        Dim dDir As DirectoryInfo<br />
<br />
        For Each sDir As String In dirs<br />
            If Not Directory.Exists(sDir) Then Continue For<br />
            dDir = New DirectoryInfo(sDir)<br />
            For Each ext As String In patterns<br />
                For Each fi As FileInfo In dDir.GetFileSystemInfos("*." & ext)<br />
                    ListBox1.Items.Add(fi.Name)<br />
                Next<br />
            Next<br />
        Next<br />
      End Sub


The second function connects to an access database pulling data from tblExclude. The table has three fields(ExcludeID, ExcludeFilePath, ExcludeFileName). The code that I have will read the data in tblExclude and display the columns rows into listbox2.

Here is the code:

Private Sub SearchDatabase()<br />
<br />
        Dim myConnString As String = "Provider=Microsoft.Jet.OleDB.4.0;Data Source=" & Application.StartupPath & "\File.mdb"<br />
        Dim myConnection As New OleDbConnection(myConnString)<br />
        myConnection.Open()<br />
        Dim strSQL As String = "SELECT ExcludeFileName FROM tblExclude"<br />
        Dim cmd As OleDbCommand = New OleDbCommand(strSQL, myConnection)<br />
        Dim objread As OleDbDataReader<br />
        objread = cmd.ExecuteReader<br />
<br />
        While objread.Read<br />
            Me.ListBox2.Items.Add(objread("ExcludeFileName") & "")<br />
        End While<br />
        objread.Close()<br />
        myConnection.Close()<br />
<br />
        Me.ListBox2.SelectedIndex = 0<br />
      End Sub



I need these two functions to some how interact with each other to get it to do what I want it to do. I want to be able to check the db table to see if a specific file exist. If the ExcludeFilePath in tblExclude is equal to the file path in textbox1 then display ExcludeFileName from tblExclude into listbox2. If the ExcludeFilePath in tblExclude does not equal the path in textbox1 then perform the first function. I know that this may be a lot of information but I want to make sure it is comprehendible.

jds1207
AnswerRe: pull data from access database table to vb.net Pin
Dave Kreskowiak23-May-07 6:43
mveDave Kreskowiak23-May-07 6:43 
QuestionUsing the character '&' in Label.Text Pin
RichFeldman23-May-07 3:44
RichFeldman23-May-07 3:44 
AnswerRe: Using the character '&' in Label.Text Pin
Kschuler23-May-07 4:10
Kschuler23-May-07 4:10 
Questionhow do u communicate btn a webserver and a remote computer via the internet? Pin
dleo1023-May-07 3:22
dleo1023-May-07 3:22 
AnswerRe: how do u communicate btn a webserver and a remote computer via the internet? Pin
Dave Herren23-May-07 3:36
Dave Herren23-May-07 3:36 
QuestionMS Outlook macro help... Pin
Fred_Smith23-May-07 2:18
Fred_Smith23-May-07 2:18 
AnswerRe: MS Outlook macro help... Pin
Dave Kreskowiak23-May-07 6:01
mveDave Kreskowiak23-May-07 6:01 
GeneralRe: MS Outlook macro help... Pin
Fred_Smith23-May-07 6:19
Fred_Smith23-May-07 6:19 
GeneralRe: MS Outlook macro help... Pin
Dave Kreskowiak23-May-07 6:33
mveDave Kreskowiak23-May-07 6:33 
GeneralRe: MS Outlook macro help... Pin
Fred_Smith23-May-07 6:43
Fred_Smith23-May-07 6:43 
Questionfour events and one handler Pin
Sonia Gupta23-May-07 1:28
Sonia Gupta23-May-07 1:28 
AnswerRe: four events and one handler Pin
CPallini23-May-07 1:38
mveCPallini23-May-07 1:38 
GeneralRe: four events and one handler Pin
Sonia Gupta23-May-07 1:52
Sonia Gupta23-May-07 1:52 
AnswerRe: four events and one handler Pin
Rupesh Kumar Swami23-May-07 1:40
Rupesh Kumar Swami23-May-07 1:40 
GeneralRe: four events and one handler Pin
Sonia Gupta23-May-07 1:52
Sonia Gupta23-May-07 1:52 
Questionuninstallation icon Pin
Sonia Gupta23-May-07 1:22
Sonia Gupta23-May-07 1:22 
AnswerRe: uninstallation icon Pin
kubben23-May-07 2:24
kubben23-May-07 2:24 

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.