Ask Me Help Desk

Ask Me Help Desk (https://www.askmehelpdesk.com/forum.php)
-   Other Databases (https://www.askmehelpdesk.com/forumdisplay.php?f=444)
-   -   ASP Form for update database in Sqlserver2000 (https://www.askmehelpdesk.com/showthread.php?t=1649)

  • Mar 3, 2003, 05:12 AM
    mohammad
    ASP Form for update database in Sqlserver2000
    Hello
    About how can I make update in database that was based in SQL server2000

    Details:
    I made web pages in ASP, and I want to make update in database from the ASP Page
    I made the code but it gave me a message that "operation is not allowed when the object is closed"

    Bellow you can see the codes that I made them...


    [[[[[
    ---------------------------------------------------------------------------------------------------
    Update.asp:


    <%@ Language=VBScript %>
    <HTML>
    <HEAD>
    <META NAME="GENERATOR" Content="Microsoft Visual Studio 6.0">
    </HEAD>
    <BODY>
    <%
    Frm=Request.Form
    Strname=Request.Form ("name")
    Strlname=Request.Form ("lname")
    Strphone=Request.Form ("phone")
    Strid=Request.Form ("id")
    A=Request.QueryString ("name")
    B=Request.QueryString ("lname")
    C=Request.QueryString ("phone")
    Set cn =server.CreateObject ("adodb.connection")
    Cn.Open "library"
    Sql="update test set name = & strname & , lname = & strlname & , phone = & strphone & where id = & strid & "
    Set rs = server.CreateObject ("Adodb.recordset")
    Rs.Open sql,cn,1,2
    Do while not rs.EOF
  • Apr 4, 2003, 05:50 PM
    hswes
    ASP Form for update database in Sqlserver2000
    It looks fine, but you forget to tell in your asp script what database server he should connect to. Just visit the Microsoft website and ask for asp and you find hundreds of samples how to connect to a sql server database, or if you like to have it simpler use sql server web publishing wizard and you see in the asp page how he connects.
    Good luck

    Hswes

  • All times are GMT -7. The time now is 07:21 PM.