navigation
a webmaster learning community
     Home    Register     Search      Help      Login    
FrontPage Alternative
Sponsors

Shopping Cart Software
Ecommerce software integrated into Frontpage, Dreamweaver and Golive templates. No monthly fees and available in ASP and PHP versions.

Website Templates
We also have a wide selection of Dreamweaver, Expression Web and Frontpage templates as well as webmaster tools and CSS layouts.

Frontpage website templates
Creative Website Templates for FrontPage, Dreamweaver, Flash, SwishMax

Search Forums
 

Advanced search
Recent Posts

 Todays Posts
 Most Active posts
 Posts since last visit
 My Recent Posts
 Mark posts read

 

Checking for duplicate records via DRW SOLVED!

 
View related threads: (in this forum | in all forums)

Logged in as: Guest
Users viewing this topic: none
Printable Version 

All Forums >> Web Development >> ASP and Database >> Checking for duplicate records via DRW SOLVED!
Page: [1]
 
rubyrube

 

Posts: 16
Joined: 1/4/2005
Status: offline

 
Checking for duplicate records via DRW SOLVED! - 1/7/2005 10:23:19   
I figured out how to use the DRW to check the database before entering records to prevent duplicate records. I wanted to share this with other FrontPage users. You do not have to write your own ASP code to do this, although doing so might give you more efficient code. You’ll need to add one ASP ‘If..Then’ statement to either send the user to a negative confirmation page OR add the record.

You simply use the DRW to create a “count page” of the records you’re looking for. Something like this (custom query):

"SELECT COUNT(*) FROM Questions WHERE (User_name = '" & Request.Form("Username") & "') AND (Question = '" & Request.Form("Question") &"');"

Then simply snatch the code that DRW creates, and add ut to the top of the DRW page that inserts the records.

fp_sQry="SELECT COUNT(*) FROM Questions WHERE (User_name = '" & Request.Form("Username") & "') AND (Question = '" & Request.Form("Question") &"');"
fp_sDefault="”
fp_sNoRecords=""
fp_sDataConn="PW_Question"
fp_iMaxRecords=1
fp_iCommandType=1
fp_iPageSize=0
fp_fTableFormat=True
fp_fMenuFormat=False
fp_sMenuChoice="Expr1000"
fp_sMenuValue="Expr1000"
fp_sColTypes="&Expr1000=3&"
fp_iDisplayCols=1
fp_fCustomQuery=True
BOTID=0
fp_iRegion=BOTID
%>
<!--#include file="../_fpclass/fpdbrgn1.inc"-->

<% Dim Count
Count = FP_FieldVal(fp_rs,"Expr1000") %>

<!--#include file="../_fpclass/fpdbrgn2.inc"-->

<% If Count >= 1 Then

'Already in the database

Response.Redirect "PWQC_BAD.asp"
End IF %>

….add to the DB below here….

It works for me.

Reuben
Ruby-rube:)
Page:   [1]

All Forums >> Web Development >> ASP and Database >> Checking for duplicate records via DRW SOLVED!
Page: [1]
Jump to: 1





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts