+ Reply to Thread
Results 1 to 2 of 2

Excel 2010, Access 2010, SQL Insert and Update Statments and NULL value in Field

  1. #1
    Registered User
    Join Date
    07-23-2013
    Location
    Waterloo ON Canada
    MS-Off Ver
    Excel 2010
    Posts
    4

    Excel 2010, Access 2010, SQL Insert and Update Statments and NULL value in Field

    I use Excel to Add new records and to update records in an Access DB. Some Data is required, and some is optional when the record is created; the Update is used to deal with these at a later time. The database connection is: Microsoft.Ace.OLEDB.12.0
    If an optional Field is left empty by the User, and I include it in the SQL Insert or Update statement, then I get a run-time error; it does not like data fields that are empty.
    How do I include an empty Field among other data-populated Fields in the SQL string? What is the syntax for such a situation.
    Right now it is rather complicated because I have to check to see which Fields are empty and exclude them from the SQL statements, but the problem comes back to bite me when a user does an update and the update legitimately is to remove data from a particular Field.
    Thanks

  2. #2
    Valued Forum Contributor
    Join Date
    06-19-2010
    Location
    Holywell, N Wales, UK
    MS-Off Ver
    Excel 2013
    Posts
    470

    Re: Excel 2010, Access 2010, SQL Insert and Update Statments and NULL value in Field

    Hey jmmach

    I am a complete noob to this and I have been researching a different problem but I did read that:
    you can omit fields in your query so long as the data definition in your table for these fields (i) allows Null values and (ii) specifies a default value in the table definition.

    Don't know how sound this is but I'll pass it on to give you something to check.
    Best of luck - this SQL is very unforgiving!

    Barry
    If this was helpful then please click the small star icon at the bottom left of my post. A little appreciation goes a long way.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Using DAO to pull data from Access 2010 into an Excel 2010 table
    By Ragnaros in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-23-2013, 01:28 PM
  2. excel 2010 vba to save access 2010 database and close it
    By dearnemo385 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 05-17-2012, 11:56 AM
  3. Update/Delete a Record in an Access 2010 Database using Excel VBA
    By tomlancaster in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-15-2012, 12:36 PM
  4. Update excel OLE unbound object withing Access 2010
    By Snoopy2003 in forum Excel Charting & Pivots
    Replies: 0
    Last Post: 02-23-2011, 03:17 AM
  5. Update excel OLE unbound object withing Access 2010
    By Snoopy2003 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 02-22-2011, 07:26 PM

Tags for this Thread

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1