Wrox Programmer Forums
|
Classic ASP Databases Discuss using ASP 3 to work with data in databases, including ASP Database Setup issues from the old P2P forum on this specific subtopic. See also the book forum Beginning ASP.NET Databases for questions specific to that book. NOT for ASP.NET 1.0, 1.1, or 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Databases section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old October 22nd, 2003, 05:12 AM
Authorized User
 
Join Date: Sep 2003
Posts: 72
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to zaeem Send a message via Yahoo to zaeem
Default Problem In Inserting Records in database

dim journal_key_words
                            str="dsn=sql;uid=sa;pwd=sa;" dim c,r
                                    set c=server.CreateObject("adodb.connection")
                                set r=server.CreateObject("adodb.recordset")

                    c.open str

            r.open "journal_key_words",c,2,2

            r.addnew

            r(0).value=request("accno")
            r(1).value=request("keywords")
r.update
r.close
------------------------------How I come to know that whether this record already exits, Plesae help me
Bye

Zaeem Sherazi
__________________
Zaeem Sherazi
 
Old October 22nd, 2003, 06:35 AM
Friend of Wrox
 
Join Date: Oct 2003
Posts: 479
Thanks: 0
Thanked 3 Times in 3 Posts
Send a message via MSN to surendran Send a message via Yahoo to surendran
Default

dim journal_key_words
str="dsn=sql;uid=sa;pwd=sa;"
dim c,r
set c=server.CreateObject("adodb.connection")
set r=server.CreateObject("adodb.recordset")
set r1=server.CreateObject("adodb.recordset")
c.open str
accno=Request("accno")
sql1="select * from tablename where fielname='"&accno&"'"
         r1.Open sql1,c,1,3
if r1.BOF then
sql="select * from tablename"
r.open sql c,1,3
r.addnew
            r(0).value=request("accno")
            r(1).value=request("keywords")
r.update
r.close
else
Response.Write "already exits"
end if

surendran





Similar Threads
Thread Thread Starter Forum Replies Last Post
having problem in inserting in access database alto ASP.NET 2.0 Basics 4 May 24th, 2007 08:57 PM
Problem inserting multilingual text into database salim C# 0 May 5th, 2007 11:11 AM
End Of Records database problem socoolbrewster Access 1 March 12th, 2004 07:27 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.