Results 1 to 4 of 4

Thread: Adding to a database

  1. #1
    Duncan Guest

    Adding to a database

    Could someone shine some light on my little problem:
    I'm trying to "add" entries to my Access database, and I keep getting getting the "No Record Affected"? Can some one tell me what is going on here.

    My code:
    <%

    MyDb.dbMDB = Server.MapPath(&#34;tradetech.mdb&#34
    MyDb.dbSQL=&#34;Select * FROM Events&#34;
    MyDb.dbUnit=1
    MyDb.dbColor = &#34;10,auto,lightgrey&#34;
    MyDb.dbGridtabletag = &#34;width=75% border=0 cellspacing=3 cellpadding=2&#34;
    MyDb.dbMode = &#34;both&#34;
    MyDb.dbGridInc=10
    MyDb.dbGridDisplayFlds = &#34;1,2,3,4,5,6,7,8&#34;
    MyDb.dbNavigationItem=&#34;top,prev,next,gridrow,a dd,update,delete&#34;

    &#39;These properties are for the PRO version (in addition to the extra dbNavigationItems):
    MyDb.dbEditParams=&#34;TableName=Events,BookMarkFl ds=EventID,TableTag=BORDER=2&#34;
    MyDb.dbEditFlds=&#34;1,2,3,4,5,6,7,8&#34; &#39; Note: You CANNOT include the AutoNumbered UniqueID field!

    MyDb.dbOptions = &#34;ConnectionTimeout=30, CloseConnection=True&#34;

    MyDb.ASPdbpro
    %>

  2. #2
    Omer Kudat Guest

    Adding to a database (reply)

    Hello Duncan,

    I was looking over the code you gave below, and the first thing I see is that you have not initiated the Server.Object. I am not aware of any way to start the aspdb function without including this line. I propose you add the following line to your code at the very begining of the <% delimited asp section:

    Set MyDb = Server.CreateObject(&#34;ASPdb.Pro&#34

    Apart from this one thing. I do not believe there is anyhing wrong with your code. You might also try to insert some faulty parameters into your code to see whether you get proper error messages. this would show whether the ASPdb object is working proprely.

    Take care,
    Omer.

    ------------
    Duncan at 8/19/99 4:34:27 PM

    Could someone shine some light on my little problem:
    I&#39;m trying to &#34;add&#34; entries to my Access database, and I keep getting getting the &#34;No Record Affected&#34;? Can some one tell me what is going on here.

    My code:
    <%

    MyDb.dbMDB = Server.MapPath(&#34;tradetech.mdb&#34
    MyDb.dbSQL=&#34;Select * FROM Events&#34;
    MyDb.dbUnit=1
    MyDb.dbColor = &#34;10,auto,lightgrey&#34;
    MyDb.dbGridtabletag = &#34;width=75% border=0 cellspacing=3 cellpadding=2&#34;
    MyDb.dbMode = &#34;both&#34;
    MyDb.dbGridInc=10
    MyDb.dbGridDisplayFlds = &#34;1,2,3,4,5,6,7,8&#34;
    MyDb.dbNavigationItem=&#34;top,prev,next,gridrow,a dd,update,delete&#34;

    &#39;These properties are for the PRO version (in addition to the extra dbNavigationItems):
    MyDb.dbEditParams=&#34;TableName=Events,BookMarkFl ds=EventID,TableTag=BORDER=2&#34;
    MyDb.dbEditFlds=&#34;1,2,3,4,5,6,7,8&#34; &#39; Note: You CANNOT include the AutoNumbered UniqueID field!

    MyDb.dbOptions = &#34;ConnectionTimeout=30, CloseConnection=True&#34;

    MyDb.ASPdbpro
    %>

  3. #3
    John Guest

    Adding to a database (reply)


    Hi Duncan,

    It looks like from your code that &#34;EventID&#34; is your key field. Also, I must
    assume from your dbEditFlds that field zero (0) is that field? That&#39;s the one
    field you omitted from the list. Finally, is that an auto-number field?

    I&#39;d suggest you take the working example in the pro-demo Access file and see
    how it works. Look at the troubleshooting section and make sure that you&#39;re
    not including an auto-number field in your edit field list.

    Thanks,
    John

    ------------
    Duncan at 8/19/99 4:34:27 PM

    Could someone shine some light on my little problem:
    I&#39;m trying to &#34;add&#34; entries to my Access database, and I keep getting getting the &#34;No Record Affected&#34;? Can some one tell me what is going on here.

    My code:
    <%

    MyDb.dbMDB = Server.MapPath(&#34;tradetech.mdb&#34
    MyDb.dbSQL=&#34;Select * FROM Events&#34;
    MyDb.dbUnit=1
    MyDb.dbColor = &#34;10,auto,lightgrey&#34;
    MyDb.dbGridtabletag = &#34;width=75% border=0 cellspacing=3 cellpadding=2&#34;
    MyDb.dbMode = &#34;both&#34;
    MyDb.dbGridInc=10
    MyDb.dbGridDisplayFlds = &#34;1,2,3,4,5,6,7,8&#34;
    MyDb.dbNavigationItem=&#34;top,prev,next,gridrow,a dd,update,delete&#34;

    &#39;These properties are for the PRO version (in addition to the extra dbNavigationItems):
    MyDb.dbEditParams=&#34;TableName=Events,BookMarkFl ds=EventID,TableTag=BORDER=2&#34;
    MyDb.dbEditFlds=&#34;1,2,3,4,5,6,7,8&#34; &#39; Note: You CANNOT include the AutoNumbered UniqueID field!

    MyDb.dbOptions = &#34;ConnectionTimeout=30, CloseConnection=True&#34;

    MyDb.ASPdbpro
    %>

  4. #4
    duncan Guest

    Adding to a database (reply)

    Thanks for the input!


    ------------
    John at 8/23/99 12:17:21 AM


    Hi Duncan,

    It looks like from your code that &#34;EventID&#34; is your key field. Also, I must
    assume from your dbEditFlds that field zero (0) is that field? That&#39;s the one
    field you omitted from the list. Finally, is that an auto-number field?

    I&#39;d suggest you take the working example in the pro-demo Access file and see
    how it works. Look at the troubleshooting section and make sure that you&#39;re
    not including an auto-number field in your edit field list.

    Thanks,
    John

    ------------
    Duncan at 8/19/99 4:34:27 PM

    Could someone shine some light on my little problem:
    I&#39;m trying to &#34;add&#34; entries to my Access database, and I keep getting getting the &#34;No Record Affected&#34;? Can some one tell me what is going on here.

    My code:
    <%

    MyDb.dbMDB = Server.MapPath(&#34;tradetech.mdb&#34
    MyDb.dbSQL=&#34;Select * FROM Events&#34;
    MyDb.dbUnit=1
    MyDb.dbColor = &#34;10,auto,lightgrey&#34;
    MyDb.dbGridtabletag = &#34;width=75% border=0 cellspacing=3 cellpadding=2&#34;
    MyDb.dbMode = &#34;both&#34;
    MyDb.dbGridInc=10
    MyDb.dbGridDisplayFlds = &#34;1,2,3,4,5,6,7,8&#34;
    MyDb.dbNavigationItem=&#34;top,prev,next,gridrow,a dd,update,delete&#34;

    &#39;These properties are for the PRO version (in addition to the extra dbNavigationItems):
    MyDb.dbEditParams=&#34;TableName=Events,BookMarkFl ds=EventID,TableTag=BORDER=2&#34;
    MyDb.dbEditFlds=&#34;1,2,3,4,5,6,7,8&#34; &#39; Note: You CANNOT include the AutoNumbered UniqueID field!

    MyDb.dbOptions = &#34;ConnectionTimeout=30, CloseConnection=True&#34;

    MyDb.ASPdbpro
    %>

Posting Permissions

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