Results 1 to 3 of 3

Thread: How can you check if a Data entry is a copy

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Feb 2004
    Location
    Smithfield, Utah
    Posts
    19

    How can you check if a Data entry is a copy

    I asked this earlier. I have a program I'am writting in VB that accesses an ACCESS database. How can I check to see if the SQL string I send to the database is not a copy of data already existing in the database? ***Without viewing the database on my form or in the database.*** Mind, that I'm a newbie.

  2. #2
    Sleep mode
    Join Date
    Aug 2002
    Location
    RUH
    Posts
    8,083
    Didn't that snippet I gave you solve it ?

  3. #3

    Thread Starter
    Junior Member
    Join Date
    Feb 2004
    Location
    Smithfield, Utah
    Posts
    19
    Yes. Thanks. But, I figured something else out for it instead.


    strSQLDVD = "select * from DVD where MovieTitle = '" & Me.txtMovieTitle.Text & "' and YearReleased = " & Me.txtReleased.Text & " and Rating = '" & Me.txtRating.Text & "' and Subject = '" & Me.txtSubject.Text & "' and Length = '" & Me.txtLength.Text & "'"

    rstDVDCheck.Open(strSQLDVD, cnnDVD, ADODB.CursorTypeEnum.adOpenStatic)

    If rstDVDCheck.RecordCount = 0 Then

    strSQLDVD = "insert into DVD (MovieTitle, YearReleased, Rating, Subject, Length) values ('" & Me.txtMovieTitle.Text & "','" & Me.txtReleased.Text & "','" & Me.txtRating.Text & "','" & Me.txtSubject.Text & "','" & Me.txtLength.Text & "')"

    Else

    If MsgBox("This file already Exists.", MsgBoxStyle.OKOnly) = MsgBoxResult.OK Then

    If MsgBox("Would you like to clear the fields?", MsgBoxStyle.YesNo) = MsgBoxResult.Yes Then

    Reset()

    Else

    cnnDVD.Execute(strSQLDVD)

    I did it like this. That way nothing will be saved, and fields will be cleared. Or if it's a new file, it'll be saved.

    Thanks for your help though.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width