If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Key violation problem when i import the text file
Hi:
I create a table with 5 field without any records, and i want to import a text file to update the table. I have a field "ID" which is primary key for the table, i set it to be "autonumber". When i import the external file, it says "error due to key violation".and only a few records can be imported to the table, and it does not create the primary key for it. It works pretty well in 97 version, i just converted it to 2003 version, Anybody can help?!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! |
#2
|
|||
|
|||
Key violation problem when i import the text file
If you are trying to create a key when a key is already there, that won'
work. Go the design view of the table, remove the key, set the field types for your records, and then try and import. Or import the file, then go in and set or reset the key and name the fields and types as needed. " wrote: Hi: I create a table with 5 field without any records, and i want to import a text file to update the table. I have a field "ID" which is primary key for the table, i set it to be "autonumber". When i import the external file, it says "error due to key violation".and only a few records can be imported to the table, and it does not create the primary key for it. It works pretty well in 97 version, i just converted it to 2003 version, Anybody can help?!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! |
#3
|
|||
|
|||
Key violation problem when i import the text file
On Jun 5, 1:48 pm, Golfinray
wrote: If you are trying to create a key when a key is already there, that won' work. Go the design view of the table, remove the key, set the field types for your records, and then try and import. Or import the file, then go in and set or reset the key and name the fields and types as needed. " wrote: Hi: I create a table with 5 field without any records, and i want to import a text file to update the table. I have a field "ID" which is primary key for the table, i set it to be "autonumber". When i import the external file, it says "error due to key violation".and only a few records can be imported to the table, and it does not create the primary key for it. It works pretty well in 97 version, i just converted it to 2003 version, Anybody can help?!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! yes that's rite. but i want Access to create it automatically. is that possible when i import the file. bcuz it works in 97 version, i suppose there must be a way to do that in 2003. for instance: the import file is : 2008401 333 222 110 2008401 333 222 111 2008401 333 222 112 2008402 333 222 113 when i import this in 97version, it automatically create the PK. looks like: KEY DATE NUM NUM NUM 1 2008401 333 222 110 2 2008401 333 222 111 3 2008401 333 222 112 4 2008402 333 222 113 But it doesnt work in 2003. Do you know how to fix this? |
#4
|
|||
|
|||
Key violation problem when i import the text file
Delete the key you have now and when you import it will ask if you to allow
access to create a key. Say yes and it will create an autonumber field, but not if one is already there. " wrote: On Jun 5, 1:48 pm, Golfinray wrote: If you are trying to create a key when a key is already there, that won' work. Go the design view of the table, remove the key, set the field types for your records, and then try and import. Or import the file, then go in and set or reset the key and name the fields and types as needed. " wrote: Hi: I create a table with 5 field without any records, and i want to import a text file to update the table. I have a field "ID" which is primary key for the table, i set it to be "autonumber". When i import the external file, it says "error due to key violation".and only a few records can be imported to the table, and it does not create the primary key for it. It works pretty well in 97 version, i just converted it to 2003 version, Anybody can help?!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! yes that's rite. but i want Access to create it automatically. is that possible when i import the file. bcuz it works in 97 version, i suppose there must be a way to do that in 2003. for instance: the import file is : 2008401 333 222 110 2008401 333 222 111 2008401 333 222 112 2008402 333 222 113 when i import this in 97version, it automatically create the PK. looks like: KEY DATE NUM NUM NUM 1 2008401 333 222 110 2 2008401 333 222 111 3 2008401 333 222 112 4 2008402 333 222 113 But it doesnt work in 2003. Do you know how to fix this? |
#5
|
|||
|
|||
Key violation problem when i import the text file
On Jun 5, 2:36 pm, Golfinray
wrote: Delete the key you have now and when you import it will ask if you to allow access to create a key. Say yes and it will create an autonumber field, but not if one is already there. " wrote: On Jun 5, 1:48 pm, Golfinray wrote: If you are trying to create a key when a key is already there, that won' work. Go the design view of the table, remove the key, set the field types for your records, and then try and import. Or import the file, then go in and set or reset the key and name the fields and types as needed. " wrote: Hi: I create a table with 5 field without any records, and i want to import a text file to update the table. I have a field "ID" which is primary key for the table, i set it to be "autonumber". When i import the external file, it says "error due to key violation".and only a few records can be imported to the table, and it does not create the primary key for it. It works pretty well in 97 version, i just converted it to 2003 version, Anybody can help?!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! yes that's rite. but i want Access to create it automatically. is that possible when i import the file. bcuz it works in 97 version, i suppose there must be a way to do that in 2003. for instance: the import file is : 2008401 333 222 110 2008401 333 222 111 2008401 333 222 112 2008402 333 222 113 when i import this in 97version, it automatically create the PK. looks like: KEY DATE NUM NUM NUM 1 2008401 333 222 110 2 2008401 333 222 111 3 2008401 333 222 112 4 2008402 333 222 113 But it doesnt work in 2003. Do you know how to fix this? Thank you a lot ........ do you mind just one more question.. i just want a form to support several parameters for report.it has nothing to do wi query. for example: i want the user to enter the parameter when they open the report, then what they entered directly go into the specific place i specify. For the original one i just put something like "=[Enter the Invoice Number]" "=[Enter the beginning date]" "=[Enter the ending date]" at different place in report. I just want a form to support several parameters. I use " Forms! [input]![Label1]" " Forms![input]![Label2]"..........however it doesnt work.. Really thx for your help!!!!!!! |
#6
|
|||
|
|||
Key violation problem when i import the text file
I think you need =forms![input].label2
" wrote: On Jun 5, 2:36 pm, Golfinray wrote: Delete the key you have now and when you import it will ask if you to allow access to create a key. Say yes and it will create an autonumber field, but not if one is already there. " wrote: On Jun 5, 1:48 pm, Golfinray wrote: If you are trying to create a key when a key is already there, that won' work. Go the design view of the table, remove the key, set the field types for your records, and then try and import. Or import the file, then go in and set or reset the key and name the fields and types as needed. " wrote: Hi: I create a table with 5 field without any records, and i want to import a text file to update the table. I have a field "ID" which is primary key for the table, i set it to be "autonumber". When i import the external file, it says "error due to key violation".and only a few records can be imported to the table, and it does not create the primary key for it. It works pretty well in 97 version, i just converted it to 2003 version, Anybody can help?!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! yes that's rite. but i want Access to create it automatically. is that possible when i import the file. bcuz it works in 97 version, i suppose there must be a way to do that in 2003. for instance: the import file is : 2008401 333 222 110 2008401 333 222 111 2008401 333 222 112 2008402 333 222 113 when i import this in 97version, it automatically create the PK. looks like: KEY DATE NUM NUM NUM 1 2008401 333 222 110 2 2008401 333 222 111 3 2008401 333 222 112 4 2008402 333 222 113 But it doesnt work in 2003. Do you know how to fix this? Thank you a lot ........ do you mind just one more question.. i just want a form to support several parameters for report.it has nothing to do wi query. for example: i want the user to enter the parameter when they open the report, then what they entered directly go into the specific place i specify. For the original one i just put something like "=[Enter the Invoice Number]" "=[Enter the beginning date]" "=[Enter the ending date]" at different place in report. I just want a form to support several parameters. I use " Forms! [input]![Label1]" " Forms![input]![Label2]"..........however it doesnt work.. Really thx for your help!!!!!!! |
#7
|
|||
|
|||
Key violation problem when i import the text file
A caveat about deleting a Primary Key/autonumber field ...
If that Primary Key is used in any other tables (as a foreign key), deleting the field will "orphan" those related records in the other tables. Regards Jeff Boyce Microsoft Office/Access MVP "Golfinray" wrote in message ... Delete the key you have now and when you import it will ask if you to allow access to create a key. Say yes and it will create an autonumber field, but not if one is already there. " wrote: On Jun 5, 1:48 pm, Golfinray wrote: If you are trying to create a key when a key is already there, that won' work. Go the design view of the table, remove the key, set the field types for your records, and then try and import. Or import the file, then go in and set or reset the key and name the fields and types as needed. " wrote: Hi: I create a table with 5 field without any records, and i want to import a text file to update the table. I have a field "ID" which is primary key for the table, i set it to be "autonumber". When i import the external file, it says "error due to key violation".and only a few records can be imported to the table, and it does not create the primary key for it. It works pretty well in 97 version, i just converted it to 2003 version, Anybody can help?!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! yes that's rite. but i want Access to create it automatically. is that possible when i import the file. bcuz it works in 97 version, i suppose there must be a way to do that in 2003. for instance: the import file is : 2008401 333 222 110 2008401 333 222 111 2008401 333 222 112 2008402 333 222 113 when i import this in 97version, it automatically create the PK. looks like: KEY DATE NUM NUM NUM 1 2008401 333 222 110 2 2008401 333 222 111 3 2008401 333 222 112 4 2008402 333 222 113 But it doesnt work in 2003. Do you know how to fix this? |
Thread Tools | |
Display Modes | |
|
|