Need Help Visual Basic

Discussion in 'Programming' started by dasha101, Jan 2, 2011.

  1. #1
    Hello Everyone!

    I hope you can help me. I have a problem with creating a code in visual basic.

    I have tried to find any available sources at the Net but I cant find one.

    I am trying to make a stand alone Plagiarism checker. The purpose of it is to search if an entered article/essay is plagiarized or not. I have already made the add/delete function but not the checker function....

    Does anybody know the code. Its like an "exact sentence matching" code. Say, if I entered an article to the form and then I click search, it should display the titles of the article/s containing sentence/s that match from the article entered.

    I think the code should be able to cut the entered article into sentences and search for it from the database until all the sentences were checked...a loop.

    Thanks in advance!!!
     
    dasha101, Jan 2, 2011 IP
  2. kp_mastermind

    kp_mastermind Active Member

    Messages:
    885
    Likes Received:
    17
    Best Answers:
    0
    Trophy Points:
    58
    #2
    Use string split and then string compare functions
     
    kp_mastermind, Jan 2, 2011 IP
  3. dasha101

    dasha101 Peon

    Messages:
    63
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #3
    I have started making this but the output for checker does not search for the substring within the string. below is the code:

    Private Sub Command2_Click()
    Dim cWords() As String
    Dim a As String
    Dim i As Integer
    Dim results(), Sqlstr, Searchstring As String
    Dim list_item As ListItem
    Dim QCounter
    a = txtPar.Text
    cWords = Split(a, ".")

    For i = 0 To UBound(cWords)

    Sqlstr = Trim(cWords(i))
    rs_check.Open "Select * from tblArticles where Title LIKE '" & Sqlstr & "'", CN, adOpenStatic, adLockOptimistic


    Do While Not rs_check.EOF
    Call EnableControls
    rs_check.MoveNext
    Loop


    rs_check.Close
    Next i
    End Sub

    Sub EnableControls()
    no_rec = True
    With rs_check
    With ListView1
    'do While Not rs_check.EOF
    .ListItems.Add , , rs_check!Title
    rs_check.MoveNext
    'Loop
    If rs_check.RecordCount > 0 Then rs_check.AbsolutePosition = ListView1.SelectedItem.Index
    End With
    End With
    ListView1.Refresh

    End Sub

    what could have been improve on this, please help. this only shows results if the string exactly matches the field from database. I want to be able to search the substring from the string from field of database. Thanks PLease Help!!!!
     
    dasha101, Jun 18, 2011 IP