Results 1 to 2 of 2

Thread: DSN Lost on Edit

  1. #1
    Joe Beernink Guest

    DSN Lost on Edit

    I have an aspdb grid which populates fine... but when I hit the Edit Button, I get DataSourceName not found... Anybody know why? Code included below... The connection information is coming from a previous screen...

    Thanks

    Joe

    <%@ Language=VBScript %>
    <SCRIPT id=DebugDirectives runat=server language=javascript>
    // Set these to true to enable debugging or tracing
    @set @debug=false
    @set @trace=false
    </SCRIPT>

    <HTML>
    <HEAD>
    <META NAME=&#34;GENERATOR&#34; Content=&#34;Microsoft Visual Studio 6.0&#34;>
    </HEAD>
    <BODY>

    <H1> Flight Range Maintenance </H1>

    <Script Language=&#34;JavaScript&#34;>
    function EditValidate()
    {
    EffDtVal = document.EDFORM_101.effective_dt.value;
    EffDt = EffDtVal.valueOf();
    DiscDtVal = document.EDFORM_101.discontinue_dt.value;
    DiscDt = DiscDtVal.valueOf();

    if( EffDt > DiscDt )
    {
    alert( &#39;
    The Effective date cannot be greater than the discontinue Date.

    Please try again.&#39; );
    return false;
    }
    return true;
    }

    </Script>

    <P>
    <%
    Dim connect_string

    &#39; Set variables needed for connection
    userid=Request.Form(&#34;txtUserid&#34
    connect_string = &#34;DSN=&#34; & Request.Form(&#34;lstDatabase&#34 & &#34;;UID=&#34; & Request.Form(&#34;txtUserid&#34 & &#34;;PWD=&#34; & Request.Form(&#34;txtPassword&#34
    EF = &#34;&#34;
    EF = &#34;id[0], range_start_i, range_stop_i, airline_cd_s, op_airline_cd_s, range_type, descr, rev_managed_ind_c, effective_dt, discontinue_dt, 10[timestamp(mm/dd/yyyy)], 11[userid]&#34;

    &#39; Response.Write(connect_string)

    &#39;Create the ASP-db™ object:
    Set MyDb = Server.CreateObject(&#34;ASP.db&#34
    &#39;Set up DSN
    MyDb.dbDSN = connect_string
    MyDB.dbDBType=&#34;SQL&#34;
    MyDb.dbColor = &#34;7&#34; &#39; Pick color scheme 7
    MyDB.dbUnit = 101 &#39; This is an identifier for the grid
    MyDb.dbMode = &#34;dual&#34; &#39; Want both Grid and Form
    MyDb.dbGridTableTag=&#34;BORDER=3&#34; &#39; Set table border=3
    MyDB.dbNavigationItem = &#34;Prev, Edit, Next, Add, Update, Delete&#34;
    &#39;Select which Table and Fields to show:
    MyDb.dbSQL = &#34;Select * FROM aag_flt_range&#34;
    MyDB.dbNameMap = &#34;range_id_i, ID; range_start_i, Range Start; range_stop_i, Range Stop; airline_cd_s, Airline; op_airline_cd_s, Operating Airline; descr, Description;range_type, Range Type; rev_managed_ind_c, Revenue Managed; effective_dt, Effective Date; discontinue_dt, Discontinue Date; mod_dt, Last Modified Date;mod_id, Last Modified By&#34;
    MyDb.dbEditFlds = EF
    MyDB.dbEditParams = &#34;tablename=aag_flt_range, BookMarkFlds = range_start_i+range_stop_i+effective_dt,recordscop e=single,EditValidateName=EditValidate()&#34;
    MyDb.dbEditAddROFlds = &#34;range_id_i, mod_dt, mod_id&#34;
    MyDb.dbEditUpdateROFlds = &#34;range_id_i, mod_dt, mod_id&#34;
    MyDB.dbTestBlankSQL = &#34;Select first 1 range_start_i from aag_flt_range&#34;
    MyDb.ASPdb &#39; Show the Database now!
    %>


    </BODY>
    </HTML>


  2. #2
    Mark Guest

    DSN Lost on Edit (reply)

    Joe,

    You must save the request(lstDatabase) etc the first time in. Subsequent page displays (like when edit is clicked) causes request to be empty. So just save it in a sesion variable. We have many examples of this on our site at:
    http://www.aspdb.com/apps (example 60 is a good one to look at)

    Mark.


    ------------
    Joe Beernink at 11/14/00 1:35:45 PM

    I have an aspdb grid which populates fine... but when I hit the Edit Button, I get DataSourceName not found... Anybody know why? Code included below... The connection information is coming from a previous screen...

    Thanks

    Joe

    <%@ Language=VBScript %>
    <SCRIPT id=DebugDirectives runat=server language=javascript>
    // Set these to true to enable debugging or tracing
    @set @debug=false
    @set @trace=false
    </SCRIPT>

    <HTML>
    <HEAD>
    <META NAME=&#34;GENERATOR&#34; Content=&#34;Microsoft Visual Studio 6.0&#34;>
    </HEAD>
    <BODY>

    <H1> Flight Range Maintenance </H1>

    <Script Language=&#34;JavaScript&#34;>
    function EditValidate()
    {
    EffDtVal = document.EDFORM_101.effective_dt.value;
    EffDt = EffDtVal.valueOf();
    DiscDtVal = document.EDFORM_101.discontinue_dt.value;
    DiscDt = DiscDtVal.valueOf();

    if( EffDt > DiscDt )
    {
    alert( &#39;
    The Effective date cannot be greater than the discontinue Date.

    Please try again.&#39; );
    return false;
    }
    return true;
    }

    </Script>

    <P>
    <%
    Dim connect_string

    &#39; Set variables needed for connection
    userid=Request.Form(&#34;txtUserid&#34
    connect_string = &#34;DSN=&#34; & Request.Form(&#34;lstDatabase&#34 & &#34;;UID=&#34; & Request.Form(&#34;txtUserid&#34 & &#34;;PWD=&#34; & Request.Form(&#34;txtPassword&#34
    EF = &#34;&#34;
    EF = &#34;id[0], range_start_i, range_stop_i, airline_cd_s, op_airline_cd_s, range_type, descr, rev_managed_ind_c, effective_dt, discontinue_dt, 10[timestamp(mm/dd/yyyy)], 11[userid]&#34;

    &#39; Response.Write(connect_string)

    &#39;Create the ASP-db™ object:
    Set MyDb = Server.CreateObject(&#34;ASP.db&#34
    &#39;Set up DSN
    MyDb.dbDSN = connect_string
    MyDB.dbDBType=&#34;SQL&#34;
    MyDb.dbColor = &#34;7&#34; &#39; Pick color scheme 7
    MyDB.dbUnit = 101 &#39; This is an identifier for the grid
    MyDb.dbMode = &#34;dual&#34; &#39; Want both Grid and Form
    MyDb.dbGridTableTag=&#34;BORDER=3&#34; &#39; Set table border=3
    MyDB.dbNavigationItem = &#34;Prev, Edit, Next, Add, Update, Delete&#34;
    &#39;Select which Table and Fields to show:
    MyDb.dbSQL = &#34;Select * FROM aag_flt_range&#34;
    MyDB.dbNameMap = &#34;range_id_i, ID; range_start_i, Range Start; range_stop_i, Range Stop; airline_cd_s, Airline; op_airline_cd_s, Operating Airline; descr, Description;range_type, Range Type; rev_managed_ind_c, Revenue Managed; effective_dt, Effective Date; discontinue_dt, Discontinue Date; mod_dt, Last Modified Date;mod_id, Last Modified By&#34;
    MyDb.dbEditFlds = EF
    MyDB.dbEditParams = &#34;tablename=aag_flt_range, BookMarkFlds = range_start_i+range_stop_i+effective_dt,recordscop e=single,EditValidateName=EditValidate()&#34;
    MyDb.dbEditAddROFlds = &#34;range_id_i, mod_dt, mod_id&#34;
    MyDb.dbEditUpdateROFlds = &#34;range_id_i, mod_dt, mod_id&#34;
    MyDB.dbTestBlankSQL = &#34;Select first 1 range_start_i from aag_flt_range&#34;
    MyDb.ASPdb &#39; Show the Database now!
    %>


    </BODY>
    </HTML>


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •