|
-
Mar 10th, 2004, 06:43 PM
#1
Thread Starter
Junior Member
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.
-
Mar 11th, 2004, 03:14 AM
#2
Sleep mode
Didn't that snippet I gave you solve it ?
-
Mar 11th, 2004, 08:42 AM
#3
Thread Starter
Junior Member
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|