Wrox Programmer Forums
|
SQL Server ASP Discussions about ASP programming with Microsoft's SQL Server. For more ASP forums, see the ASP forum category.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the SQL Server ASP 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 September 5th, 2003, 04:02 PM
Registered User
 
Join Date: Sep 2003
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default How to add records

Hi everyone

I would just like to know the method to add a new record in SQL server database with ASP?

Can anyone help?

Thanks

HD

 
Old September 6th, 2003, 06:32 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 344
Thanks: 0
Thanked 1 Time in 1 Post
Default

There is an ADD method of some types of connection. Alternatively you can use the EXECUTE method to execute some SQL that could be an INSERT statement in SQL.
 
Old September 24th, 2003, 12:43 AM
Friend of Wrox
 
Join Date: Sep 2003
Posts: 171
Thanks: 0
Thanked 1 Time in 1 Post
Default

Let me know how this works. Thanks.

<%
    set db = server.createobject("adodb.connection")
    db.connectionString = "provider=sqloledb.1; user id=MyUserId; password=MyPassword; data source=MyServer; initial catalog=MyDatabase"
    db.mode=3
    db.cursorlocation=3
    db.open

    set rs = server.createobject("adodb.recordset")
    sql = "select * from table"
    rs.open sql, db, 3, 3
    rs.addnew
    rs("field1") = Value1
    rs("field2") = Value2
    rs("field3") = Value3
    rs.update
%>






Similar Threads
Thread Thread Starter Forum Replies Last Post
Add records with VBA rohit_ghosh Access VBA 2 June 22nd, 2007 04:13 AM
Need help with a query to add records chacquard Access VBA 1 February 28th, 2005 04:23 PM
how to know who edit or add records? drachx General .NET 1 October 13th, 2004 05:36 AM
how to know who edit add records? drachx SQL Server 2000 9 October 13th, 2004 04:28 AM
Add records from a Datagrid dkomo VB.NET 0 May 6th, 2004 01:08 PM





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