Results 1 to 5 of 5

Thread: Inserting Dates in Access with a field defined as a date/time field

  1. #1
    Nathaniel Tucker Guest

    Inserting Dates in Access with a field defined as a date/time field

    I am having problems adding & updating records with dates and times. My code is as follows:

    Set MyDb = Server.CreateObject("AspDB.Pro&#34
    MyDb.dbmdb=Server.MapPath("/databases/calendars/calendars.mdb&#34
    MyDb.dbMode="both"
    MyDb.dbUnit=1
    MyDb.dbGridInc=20
    MyDb.dbGridDisplayFlds="Date,Event"
    MyDb.dbFormDisplayFlds="Date,Event,Place,Time, Contact,Email,Semester,Text"
    MyDb.dbNavigation="bottom"
    MyDb.dbStatusBar=False
    MyDb.dbNavigationItem="top,bottom,prev,next,ad d,update,reload"
    MyDb.dbMemoTextSize="-1"
    MyDb.dbEditHideFlds="Index,Category"
    MyDb.dbEditUpdateROFlds="Index,Category"
    Mydb.dbEditFlds = "Date,Event,Place,Time,Contact,Email,Catego ry[Events],Semester,Text"
    EP = "TableName=Q_Update_Event, BookMarkFlds=Index, TableTag=Border=0"
    EP = EP & ", size200=1x75, inputsize=5x75"
    EP = EP & ", RecordScope=single"
    MyDb.dbEditParams = EP
    MyDb.dbGridIndex="False"
    MyDb.dbMagicCell="Event,,#Event#,index,indexan chor;"
    MyDb.dbSQL="Select * FROM [Q_Update_Event]"
    MyDb.aspDBPro
    -------------------------
    This is the error that I am getting:

    Error # = 80040E14
    Description = [Microsoft][ODBC Microsoft Access Driver] Syntax error in INSERT INTO statement.
    Source = Microsoft OLE DB Provider for ODBC Drivers
    SQL State = 37000
    NativeError = -3502

  2. #2
    Frank Guest

    Inserting Dates in Access with a field defined as a date/time field (reply)

    Just taking a quick look at your problem. "Index" is a reserved word and that should be enough to mess you up. Change that firld name to something else first and if still have problem, turn on the debug and look at theEdit SQL statement.


    Fk



    ------------
    Nathaniel Tucker at 12/8/99 5:01:23 PM

    I am having problems adding & updating records with dates and times. My code is as follows:

    Set MyDb = Server.CreateObject("AspDB.Pro&#34
    MyDb.dbmdb=Server.MapPath("/databases/calendars/calendars.mdb&#34
    MyDb.dbMode="both"
    MyDb.dbUnit=1
    MyDb.dbGridInc=20
    MyDb.dbGridDisplayFlds="Date,Event"
    MyDb.dbFormDisplayFlds="Date,Event,Place,Time, Contact,Email,Semester,Text"
    MyDb.dbNavigation="bottom"
    MyDb.dbStatusBar=False
    MyDb.dbNavigationItem="top,bottom,prev,next,ad d,update,reload"
    MyDb.dbMemoTextSize="-1"
    MyDb.dbEditHideFlds="Index,Category"
    MyDb.dbEditUpdateROFlds="Index,Category"
    Mydb.dbEditFlds = "Date,Event,Place,Time,Contact,Email,Catego ry[Events],Semester,Text"
    EP = "TableName=Q_Update_Event, BookMarkFlds=Index, TableTag=Border=0"
    EP = EP & ", size200=1x75, inputsize=5x75"
    EP = EP & ", RecordScope=single"
    MyDb.dbEditParams = EP
    MyDb.dbGridIndex="False"
    MyDb.dbMagicCell="Event,,#Event#,index,indexan chor;"
    MyDb.dbSQL="Select * FROM [Q_Update_Event]"
    MyDb.aspDBPro
    -------------------------
    This is the error that I am getting:

    Error # = 80040E14
    Description = [Microsoft][ODBC Microsoft Access Driver] Syntax error in INSERT INTO statement.
    Source = Microsoft OLE DB Provider for ODBC Drivers
    SQL State = 37000
    NativeError = -3502

  3. #3
    Nathaniel Tucker Guest

    Inserting Dates in Access with a field defined as a date/time field (reply)

    I made that change, but still having problems...getting the same error.

    Thanks,

    nate


    ------------
    Frank at 12/8/99 11:37:37 PM

    Just taking a quick look at your problem. "Index" is a reserved word and that should be enough to mess you up. Change that firld name to something else first and if still have problem, turn on the debug and look at theEdit SQL statement.


    Fk



    ------------
    Nathaniel Tucker at 12/8/99 5:01:23 PM

    I am having problems adding & updating records with dates and times. My code is as follows:

    Set MyDb = Server.CreateObject("AspDB.Pro&#34
    MyDb.dbmdb=Server.MapPath("/databases/calendars/calendars.mdb&#34
    MyDb.dbMode="both"
    MyDb.dbUnit=1
    MyDb.dbGridInc=20
    MyDb.dbGridDisplayFlds="Date,Event"
    MyDb.dbFormDisplayFlds="Date,Event,Place,Time, Contact,Email,Semester,Text"
    MyDb.dbNavigation="bottom"
    MyDb.dbStatusBar=False
    MyDb.dbNavigationItem="top,bottom,prev,next,ad d,update,reload"
    MyDb.dbMemoTextSize="-1"
    MyDb.dbEditHideFlds="Index,Category"
    MyDb.dbEditUpdateROFlds="Index,Category"
    Mydb.dbEditFlds = "Date,Event,Place,Time,Contact,Email,Catego ry[Events],Semester,Text"
    EP = "TableName=Q_Update_Event, BookMarkFlds=Index, TableTag=Border=0"
    EP = EP & ", size200=1x75, inputsize=5x75"
    EP = EP & ", RecordScope=single"
    MyDb.dbEditParams = EP
    MyDb.dbGridIndex="False"
    MyDb.dbMagicCell="Event,,#Event#,index,indexan chor;"
    MyDb.dbSQL="Select * FROM [Q_Update_Event]"
    MyDb.aspDBPro
    -------------------------
    This is the error that I am getting:

    Error # = 80040E14
    Description = [Microsoft][ODBC Microsoft Access Driver] Syntax error in INSERT INTO statement.
    Source = Microsoft OLE DB Provider for ODBC Drivers
    SQL State = 37000
    NativeError = -3502

  4. #4
    Nathaniel Tucker Guest

    Inserting Dates in Access with a field defined as a date/time field (reply)

    Here is my code.... It won't allow me to key in a date into the record. The actual Access 97 record is set to type 'Date/Time'. If I leave that field blank, it works fine, but errors when there is data entered. Any help would be appreciated:

    <%
    Set MyDb = Server.CreateObject(&#34;AspDB.Pro&#34
    MyDb.dbmdb=Server.MapPath(&#34;/databases/calendars/calendars.mdb&#34
    MyDb.dbMode=&#34;both&#34;
    MyDb.dbUnit=1
    MyDb.dbGridInc=20
    MyDb.dbGridDisplayFlds=&#34;Date,Event&#34;
    MyDb.dbFormDisplayFlds=&#34;Date,Event,Place,Time, Contact,Email,Semester,Text&#34;
    MyDb.dbNavigation=&#34;bottom&#34;
    MyDb.dbStatusBar=False
    MyDb.dbNavigationItem=&#34;top,bottom,prev,next,ad d,update,reload&#34;
    MyDb.dbMemoTextSize=&#34;-1&#34;
    MyDb.dbEditHideFlds=&#34;KIndex,Category&#34;
    MyDb.dbEditUpdateROFlds=&#34;KIndex,Category&#34;
    Mydb.dbEditFlds = &#34;Date,Event,Place,Time,Contact,Email,Catego ry [Events],Semester,Text&#34;
    EP = &#34;TableName=Q_Update_Event, BookMarkFlds=KIndex, TableTag=Border=0&#34;
    EP = EP & &#34;, size200=1x75, inputsize=5x75&#34;
    EP = EP & &#34;, RecordScope=single&#34;
    MyDb.dbEditParams = EP
    MyDb.dbGridIndex=&#34;False&#34;
    MyDb.dbMagicCell=&#34;Event,,#Event#,index,indexan chor;&#34;
    MyDb.dbSQL=&#34;Select * FROM [Q_Update_Event]&#34;
    MyDb.aspDBPro
    %>


    ------------
    Nathaniel Tucker at 12/9/99 8:52:49 AM

    I made that change, but still having problems...getting the same error.

    Thanks,

    nate


    ------------
    Frank at 12/8/99 11:37:37 PM

    Just taking a quick look at your problem. &#34;Index&#34; is a reserved word and that should be enough to mess you up. Change that firld name to something else first and if still have problem, turn on the debug and look at theEdit SQL statement.


    Fk



    ------------
    Nathaniel Tucker at 12/8/99 5:01:23 PM

    I am having problems adding & updating records with dates and times. My code is as follows:

    Set MyDb = Server.CreateObject(&#34;AspDB.Pro&#34
    MyDb.dbmdb=Server.MapPath(&#34;/databases/calendars/calendars.mdb&#34
    MyDb.dbMode=&#34;both&#34;
    MyDb.dbUnit=1
    MyDb.dbGridInc=20
    MyDb.dbGridDisplayFlds=&#34;Date,Event&#34;
    MyDb.dbFormDisplayFlds=&#34;Date,Event,Place,Time, Contact,Email,Semester,Text&#34;
    MyDb.dbNavigation=&#34;bottom&#34;
    MyDb.dbStatusBar=False
    MyDb.dbNavigationItem=&#34;top,bottom,prev,next,ad d,update,reload&#34;
    MyDb.dbMemoTextSize=&#34;-1&#34;
    MyDb.dbEditHideFlds=&#34;Index,Category&#34;
    MyDb.dbEditUpdateROFlds=&#34;Index,Category&#34;
    Mydb.dbEditFlds = &#34;Date,Event,Place,Time,Contact,Email,Catego ry[Events],Semester,Text&#34;
    EP = &#34;TableName=Q_Update_Event, BookMarkFlds=Index, TableTag=Border=0&#34;
    EP = EP & &#34;, size200=1x75, inputsize=5x75&#34;
    EP = EP & &#34;, RecordScope=single&#34;
    MyDb.dbEditParams = EP
    MyDb.dbGridIndex=&#34;False&#34;
    MyDb.dbMagicCell=&#34;Event,,#Event#,index,indexan chor;&#34;
    MyDb.dbSQL=&#34;Select * FROM [Q_Update_Event]&#34;
    MyDb.aspDBPro
    -------------------------
    This is the error that I am getting:

    Error # = 80040E14
    Description = [Microsoft][ODBC Microsoft Access Driver] Syntax error in INSERT INTO statement.
    Source = Microsoft OLE DB Provider for ODBC Drivers
    SQL State = 37000
    NativeError = -3502

  5. #5
    Mark Guest

    Inserting Dates in Access with a field defined as a date/time field (reply)

    -----------------
    Nate,

    Set Mydb.dbDebug=True and try it again.
    That will show you the exact SQL that ASP-db was trying to execute.
    Copy and paste it into Access and let Access try to run it.
    See what happens. Also, let me know on this forum what the SQL
    statement looks like from the DEBUG output. It will probably start with:

    &#34;INSERT INTO ...&#34;

    Mark.



    ------------
    Nathaniel Tucker at 12/17/99 2:13:25 PM

    Here is my code.... It won&#39;t allow me to key in a date into the record. The actual Access 97 record is set to type &#39;Date/Time&#39;. If I leave that field blank, it works fine, but errors when there is data entered. Any help would be appreciated:

    <%
    Set MyDb = Server.CreateObject(&#34;AspDB.Pro&#34
    MyDb.dbmdb=Server.MapPath(&#34;/databases/calendars/calendars.mdb&#34
    MyDb.dbMode=&#34;both&#34;
    MyDb.dbUnit=1
    MyDb.dbGridInc=20
    MyDb.dbGridDisplayFlds=&#34;Date,Event&#34;
    MyDb.dbFormDisplayFlds=&#34;Date,Event,Place,Time, Contact,Email,Semester,Text&#34;
    MyDb.dbNavigation=&#34;bottom&#34;
    MyDb.dbStatusBar=False
    MyDb.dbNavigationItem=&#34;top,bottom,prev,next,ad d,update,reload&#34;
    MyDb.dbMemoTextSize=&#34;-1&#34;
    MyDb.dbEditHideFlds=&#34;KIndex,Category&#34;
    MyDb.dbEditUpdateROFlds=&#34;KIndex,Category&#34;
    Mydb.dbEditFlds = &#34;Date,Event,Place,Time,Contact,Email,Catego ry [Events],Semester,Text&#34;
    EP = &#34;TableName=Q_Update_Event, BookMarkFlds=KIndex, TableTag=Border=0&#34;
    EP = EP & &#34;, size200=1x75, inputsize=5x75&#34;
    EP = EP & &#34;, RecordScope=single&#34;
    MyDb.dbEditParams = EP
    MyDb.dbGridIndex=&#34;False&#34;
    MyDb.dbMagicCell=&#34;Event,,#Event#,index,indexan chor;&#34;
    MyDb.dbSQL=&#34;Select * FROM [Q_Update_Event]&#34;
    MyDb.aspDBPro
    %>


    ------------
    Nathaniel Tucker at 12/9/99 8:52:49 AM

    I made that change, but still having problems...getting the same error.

    Thanks,

    nate


    ------------
    Frank at 12/8/99 11:37:37 PM

    Just taking a quick look at your problem. &#34;Index&#34; is a reserved word and that should be enough to mess you up. Change that firld name to something else first and if still have problem, turn on the debug and look at theEdit SQL statement.


    Fk



    ------------
    Nathaniel Tucker at 12/8/99 5:01:23 PM

    I am having problems adding & updating records with dates and times. My code is as follows:

    Set MyDb = Server.CreateObject(&#34;AspDB.Pro&#34
    MyDb.dbmdb=Server.MapPath(&#34;/databases/calendars/calendars.mdb&#34
    MyDb.dbMode=&#34;both&#34;
    MyDb.dbUnit=1
    MyDb.dbGridInc=20
    MyDb.dbGridDisplayFlds=&#34;Date,Event&#34;
    MyDb.dbFormDisplayFlds=&#34;Date,Event,Place,Time, Contact,Email,Semester,Text&#34;
    MyDb.dbNavigation=&#34;bottom&#34;
    MyDb.dbStatusBar=False
    MyDb.dbNavigationItem=&#34;top,bottom,prev,next,ad d,update,reload&#34;
    MyDb.dbMemoTextSize=&#34;-1&#34;
    MyDb.dbEditHideFlds=&#34;Index,Category&#34;
    MyDb.dbEditUpdateROFlds=&#34;Index,Category&#34;
    Mydb.dbEditFlds = &#34;Date,Event,Place,Time,Contact,Email,Catego ry[Events],Semester,Text&#34;
    EP = &#34;TableName=Q_Update_Event, BookMarkFlds=Index, TableTag=Border=0&#34;
    EP = EP & &#34;, size200=1x75, inputsize=5x75&#34;
    EP = EP & &#34;, RecordScope=single&#34;
    MyDb.dbEditParams = EP
    MyDb.dbGridIndex=&#34;False&#34;
    MyDb.dbMagicCell=&#34;Event,,#Event#,index,indexan chor;&#34;
    MyDb.dbSQL=&#34;Select * FROM [Q_Update_Event]&#34;
    MyDb.aspDBPro
    -------------------------
    This is the error that I am getting:

    Error # = 80040E14
    Description = [Microsoft][ODBC Microsoft Access Driver] Syntax error in INSERT INTO statement.
    Source = Microsoft OLE DB Provider for ODBC Drivers
    SQL State = 37000
    NativeError = -3502

Posting Permissions

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