473,324 Members | 2,179 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

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

insert foreignKey value

hi,
I am trying to insert data into an MSAccess table through a datagrid. I did
it by creating a custom Insert Command.
However, the table has a foreignKey,which obviously is hidden to the user
(mappingType.hidden) and i tried to pouplate it using the code below, before
running update

//// code in Update_Click button
If ds.HasChanges Then
Dim dt As DataTable = ds.Tables("codegrid").GetChanges(DataRowState.Adde d)
dt.Rows(0)("filenamefk") = 1 'assume only one row is added and fk =1
End If
///
da.update(ds,tbl)

I can see the table updated in Access but not the fileNamefk.
Is it the correct way to include the data that is not been inserted via
datagrid, but needs to be in table.
Is there any other way to do this.

TIA
Irfan



The table has a foreignKey(which obviously is hidden to the user)
Nov 21 '05 #1
0 1015

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

Similar topics

10
by: shank | last post by:
I have a recordset that contains multiple records of product a user is purchasing. For clarity, I converted the recordset fields to variables. I need to take that entire recordset and insert it...
1
by: PT | last post by:
I got a problem. And thats..... First of all, I got these three tables. ------------------- ------------------ ---------------------- tblPerson tblPersonSoftware ...
1
by: shottarum | last post by:
I currently have 2 tables as follows: CREATE TABLE . ( mhan8 int, mhac02 varchar(5), mhmot varchar(5), mhupmj int )
1
by: GMK | last post by:
Dear all i'm having an asp.net application whci is bugging me with the following error: Foreignkey constraint does anyone know what is the cause of this error , i could not debugg it becasue...
1
by: Adjo | last post by:
Okay, I've seen all the examples of using comboboxes on webforms when using simple values. And in the issue-tracker starterkit there is a way to use comboboxes with id/value foreign keys in a smart...
2
by: Geoffrey KRETZ | last post by:
Hello, I'm wondering if the following behaviour is the correct one for PostGreSQL (7.4 on UNIX). I've a table temp_tab with 5 fields (f1,f2,f3,...),and I'm a launching the following request :...
6
by: askmatlab | last post by:
Hello all: I would like to insert a number into a linked list in ascending order. Is the following function correct? void insert(Node **node, int v) { Node *tmp = (Node...
7
by: Materialised | last post by:
Hi Folks, Just a quickie, I am inserting some records (individually) into a SQL Server Table. I am wondering how can I detect primary key violations on this data which I am inserting into the...
1
by: accessvbanewbie | last post by:
I would like to export a recordset from access to excel but after each record is exported I want to insert a new row. The first recordset does this ok. However, the second recordset onwards does not...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

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.