472,993 Members | 3,152 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,993 software developers and data experts.

Simple 'NULL' / Databiding prob got me stumped..

Ok, I'm new at this and learning as I go, but under extreme pressure
from work.. So many bugs and little tricky obsticals have got me very
far behind, and this is the latest..

I made a simple databinding form, but not using the wizard, because it
doesn't use the SQL driver.

I'm keeping it simple right now with a very normal table with a
primary key 'SIN' (social insurance number). Well I'm following
along in the book to do the whole goto next record, delete etc.. All
works.. But the problem is ADDING a record. Whenever I try, it simply
says "column 'SIN' does not allow nulls". Well no $#1T. I have a
value in the field, but it simply erases it right away and gives me
that message. I've been searching for DAYS on this, and nobody has
seemed to have it figured out in this scenario. It seems to me like
an extremly common issue..So why all the headache? None of the books
examples seem to deal with this....

btw, I've tried:
setting a default value on the SQL table itself.
changing the xml schema to not allow nulls.
changing the xml schema to assign a default value.
Nov 21 '05 #1
1 1043
James,

When you add the row, do you than something like this
dim dr as datarow = table.newrow
dr("SIN") = x
and that should be done when it is not an autokey before the
table.add(dr)

In this case this construction does not work and gives errors
table.rows.add(table.newrow)

I think "cma.newrow" as well (I never tried it, because I do not take a
field like a Security number as primary key but let a seperated autokey as
primary key run). However the way I showed above should probably overcome
your problem.

I hope this helps?

Cor
Ok, I'm new at this and learning as I go, but under extreme pressure
from work.. So many bugs and little tricky obsticals have got me very
far behind, and this is the latest..

I made a simple databinding form, but not using the wizard, because it
doesn't use the SQL driver.

I'm keeping it simple right now with a very normal table with a
primary key 'SIN' (social insurance number). Well I'm following
along in the book to do the whole goto next record, delete etc.. All
works.. But the problem is ADDING a record. Whenever I try, it simply
says "column 'SIN' does not allow nulls". Well no $#1T. I have a
value in the field, but it simply erases it right away and gives me
that message. I've been searching for DAYS on this, and nobody has
seemed to have it figured out in this scenario. It seems to me like
an extremly common issue..So why all the headache? None of the books
examples seem to deal with this....

btw, I've tried:
setting a default value on the SQL table itself.
changing the xml schema to not allow nulls.
changing the xml schema to assign a default value.

Nov 21 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: David Sobey | last post by:
Hi Sorry bout this basic prob. Got a file called file.obj. tryna read the first line from it as a string and print it to the screen. getting errors: #include "stdafx.h" #include <stdio.h>...
6
by: Dishan Fernando | last post by:
Hi my prob is like this.. DECLARE @id int SELECT * FROM Table1 WHERE ID = @ID if @ID is null , I want to select all the records, that ID is null
5
by: Daniel | last post by:
I want to do something really simple. I have a form and a class which handles my network layer The form has an instance of the network class as a member and initialises the network layer. ...
4
by: Armand | last post by:
Hi Guys, I have a set of array that I would like to clear and empty out. Since I am using "Array" not "ArrayList", I have been struggling in finding the solution which is a simple prob for those...
2
by: PokerMan | last post by:
I have this object o = ds.Tables.Rows.ItemArray; the item read from my dataset is null. I check on the next line : if(o!= null) //then do something My prob is the object o is getting...
0
by: Greg Corradini | last post by:
Hello all, I'm having trouble inserting an SQL selection into a new MS Access table. I get a parameter error on my insert statement when I try this (see below for code and error msg). I'm not sure...
2
by: harini | last post by:
i hv a datagrid to which i hv bound a table...i hv the table columns to be editable...i.e read only = false....now i hv a problem...in the table there seems to be a row at the end having no values...
0
by: Matt Michler | last post by:
I have a WebUserControl with a custom event, when this event is fired, the delegate or event object is throwing a null reference exception. The odd part of this is, it used to work flawlessly, now...
5
by: Kardon Coupé | last post by:
Dear All, I'm bemused, I'm moving an application I've written from VB6 into VS2005, and I'm getting all the fundamentals over before I delve into the hard part, like getting the forms layout...
0
by: lllomh | last post by:
Define the method first this.state = { buttonBackgroundColor: 'green', isBlinking: false, // A new status is added to identify whether the button is blinking or not } autoStart=()=>{
0
by: Aliciasmith | last post by:
In an age dominated by smartphones, having a mobile app for your business is no longer an option; it's a necessity. Whether you're a startup or an established enterprise, finding the right mobile app...
4
NeoPa
by: NeoPa | last post by:
Hello everyone. I find myself stuck trying to find the VBA way to get Access to create a PDF of the currently-selected (and open) object (Form or Report). I know it can be done by selecting :...
3
NeoPa
by: NeoPa | last post by:
Introduction For this article I'll be using a very simple database which has Form (clsForm) & Report (clsReport) classes that simply handle making the calling Form invisible until the Form, or all...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 1 Nov 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM) Please note that the UK and Europe revert to winter time on...
3
by: nia12 | last post by:
Hi there, I am very new to Access so apologies if any of this is obvious/not clear. I am creating a data collection tool for health care employees to complete. It consists of a number of...
0
isladogs
by: isladogs | last post by:
The next online meeting of the Access Europe User Group will be on Wednesday 6 Dec 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, Mike...
4
by: GKJR | last post by:
Does anyone have a recommendation to build a standalone application to replace an Access database? I have my bookkeeping software I developed in Access that I would like to make available to other...
3
SueHopson
by: SueHopson | last post by:
Hi All, I'm trying to create a single code (run off a button that calls the Private Sub) for our parts list report that will allow the user to filter by either/both PartVendor and PartType. On...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.