Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
Dim Dim is offline
external usenet poster
 
Posts: 5
Default populate Access numeric field with nothing

Hi everyone
i'm having an issue with pushing into Access DB numeric field empty
value from Excel cell using ADO
the following INSERT statement is built dymanicly picking values from
cells and is executed from Excel macro through ADO Execute command: if
a cell which related to field between #11/15/2004# and "blah" is empty
(excel format for that cell is general) the code throughs err message
that type mismatch..Access field set up:
DataType as number
Field size is Double
Required NO
NO Validation Rules , NO Validation Text

SQL statement gives err message:
INSERT INTO Tbl VALUES (99041838306,#11/15/2004#,,"blah")

this record will populate DB without problems:
INSERT INTO Tbl VALUES (99041838306,#11/15/2004#,0,"blah")
thank U in advance
Dim
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,253
Default populate Access numeric field with nothing


this works for me..

oCN.Execute "INSERT INTO tmp_test (id,rank) VALUES ('ABC',Null)"

--
keepITcool
| www.XLsupport.com | keepITcool chello nl | amsterdam

Dim wrote in message
om:

Hi everyone
i'm having an issue with pushing into Access DB numeric field empty
value from Excel cell using ADO
the following INSERT statement is built dymanicly picking values from
cells and is executed from Excel macro through ADO Execute command: if
a cell which related to field between #11/15/2004# and "blah" is empty
(excel format for that cell is general) the code throughs err message
that type mismatch..Access field set up:
DataType as number
Field size is Double
Required NO
NO Validation Rules , NO Validation Text

SQL statement gives err message:
INSERT INTO Tbl VALUES (99041838306,#11/15/2004#,,"blah")

this record will populate DB without problems:
INSERT INTO Tbl VALUES (99041838306,#11/15/2004#,0,"blah")
thank U in advance
Dim


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 170
Default populate Access numeric field with nothing

From the Help entry on INSERT INTO

"... you can specify the value for each field in a single new record using
the VALUES clause. If you omit the field list, the VALUES clause *must*
include a value for every field in the table; otherwise, the INSERT
operation will fail.-- "

Note the use of the word "must"...

VALUES (99041838306,#11/15/2004#,,"blah") doesn't supply a value for the 3rd
field. Therefore, it fails.
VALUES (99041838306,#11/15/2004#,0,"blah") does supply a value for the 3rd
field. It suceeds.


HTH,

George Nicholson

Remove 'Junk' from return address.


"Dim" wrote in message
m...
Hi everyone
i'm having an issue with pushing into Access DB numeric field empty
value from Excel cell using ADO
the following INSERT statement is built dymanicly picking values from
cells and is executed from Excel macro through ADO Execute command: if
a cell which related to field between #11/15/2004# and "blah" is empty
(excel format for that cell is general) the code throughs err message
that type mismatch..Access field set up:
DataType as number
Field size is Double
Required NO
NO Validation Rules , NO Validation Text

SQL statement gives err message:
INSERT INTO Tbl VALUES (99041838306,#11/15/2004#,,"blah")

this record will populate DB without problems:
INSERT INTO Tbl VALUES (99041838306,#11/15/2004#,0,"blah")
thank U in advance
Dim



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Populate field automatically TJAC Excel Discussion (Misc queries) 1 January 17th 07 08:02 PM
Merge an alpha field and a numeric field grams Excel Discussion (Misc queries) 3 August 29th 05 11:33 PM
Populate a field with just workdays Arlen Excel Worksheet Functions 3 January 4th 05 09:05 PM
HELP!! Populate text in single XL field, or bulk copy text into 1 field filmfatale[_2_] Excel Programming 0 December 9th 03 02:30 PM
populate concatenate field igor Excel Programming 2 August 13th 03 08:39 PM


All times are GMT +1. The time now is 04:52 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"