User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the VB.NET section within the Software Development category of DaniWeb, a massive community of 456,195 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 3,943 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our VB.NET advertiser: Programming Forums
Views: 2648 | Replies: 1
Reply
Join Date: Oct 2006
Posts: 14
Reputation: lukis is an unknown quantity at this point 
Rep Power: 3
Solved Threads: 0
lukis lukis is offline Offline
Newbie Poster

add new record to database

  #1  
May 8th, 2007
Hi there,

I have a form that adds a Customer to a database. I had set the cust_id in the Ms Access as an Autonumber. and when I open the vb form, i wrote a code that will set the textbox of the cust_id as the count of the records + 1. That is displayed correctly.

my problem is this. When I click on the button save i have the following code attached

me.databinding(dataset11, "Customer").addnew()
oledb_Cust.fill(dataset11)
 

it's telling me that since the cust_id is a primary number, it's doesn't allow it to be null. Now i'm generating that number as i specified in the first paragraph.

any help?

Thanks
Luke
AddThis Social Bookmark Button
Reply With Quote  
Join Date: May 2007
Posts: 35
Reputation: matale is an unknown quantity at this point 
Rep Power: 2
Solved Threads: 1
matale matale is offline Offline
Light Poster

Re: add new record to database

  #2  
May 8th, 2007
As I understand it ur not supposed to be inserting anything in the auto number field, Access should take care of that automaticaly.
My current Project www.footystat.com
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

DaniWeb VB.NET Marketplace
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

Thread Tools Display Modes

Similar Threads
Other Threads in the VB.NET Forum

All times are GMT -4. The time now is 3:48 pm.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC