Autonumbers无法进行预订备份 [英] Autonumbers making booking backups impossible
问题描述
怎么做,
我有三个表格中的个人详细信息,郊游详情和预订的2000访问预订数据库:
tblBookings - [预订ID] -Autonumber, [郊游ID] - 编号, [儿童ID] - 编号, [支付金额] - 货币, [存款支付] - 是/否, [运输] - 是/否
tblPersonaldetails - [儿童ID] -Autonumber等
tblOutingDetails - [Outing ID] -Autonumber等
我正在尝试恢复备份,但是由于自动编号数据类型,[子ID]和[Outing ID]与导入表中的不同,因此无法将预订导入数据库。
我使用此代码首先从备份中导入名称为[Table Name] Append的表,删除当前表中的所有数据,将附加表中的数据插入主表中,然后删除附加表。 br />
How do,
I have a access 2000 booking database with Personal Details, Outing Details and the Bookings in three tables:
tblBookings -- [Booking ID]-Autonumber, [Outing ID]-Number, [Child ID]-Number, [Amount Paid]-Currency, [Deposit Paid]-Yes/No, [Transport]-Yes/No
tblPersonaldetails -- [Child ID]-Autonumber, etc
tblOutingDetails -- [Outing ID]-Autonumber, etc
I am trying to restore backups made, but cannot import the bookings into the database as the [Child ID] and [Outing ID] are different than those in the imported tables due to the autonumber data type.
I use this code to firstly import the tables from the backup with the name "[Table Name]Append", delete all the data in the current tables, insert the data from the append tables into the main tables and then delete the append tables.
推荐答案
怎么做,
我有三个表格中的个人详细信息,郊游详情和预订的2000访问预订数据库:
tblBookings - [预订ID] -Autonumber, [郊游ID] - 编号, [儿童ID] - 编号, [已付金额] - 货币, [存款已付] - 是/否, [运输] - 是/否
tblPersonaldetails - [儿童ID] -Autonumber等
tblOutingDetails - [郊游ID] -Autonumber等
我正在尝试恢复备份,但无法将预订导入数据库,因为[子ID]和[Outing ID]由于自动编号数据而不同于导入表中的那些类型。
我使用此代码首先从备份中导入名称为[Table Name] Append的表,删除当前表中的所有数据,插入数据从追加表到主表然后删除追加表。
How do,
I have a access 2000 booking database with Personal Details, Outing Details and the Bookings in three tables:
tblBookings -- [Booking ID]-Autonumber, [Outing ID]-Number, [Child ID]-Number, [Amount Paid]-Currency, [Deposit Paid]-Yes/No, [Transport]-Yes/No
tblPersonaldetails -- [Child ID]-Autonumber, etc
tblOutingDetails -- [Outing ID]-Autonumber, etc
I am trying to restore backups made, but cannot import the bookings into the database as the [Child ID] and [Outing ID] are different than those in the imported tables due to the autonumber data type.
I use this code to firstly import the tables from the backup with the name "[Table Name]Append", delete all the data in the current tables, insert the data from the append tables into the main tables and then delete the append tables.
是的,那些都是关系。
发生的事情是:
在预订表中恢复孩子ID为3
的旧数据因此预订在儿童ID 3下
因为您不能(据我所知)更改自动编号,导入的数据将获得一个新的儿童ID:5
导入的预订但是,表仍然保持Child ID为3,现在要么不存在,要么只是错误。然后由于重大违规而停止导入预订。
在旁注中,您是否知道如何设置带有输入掩码的文本框以始终启动无论你在文本框中单击何处,都在左侧。它有点问题,但它让我很烦恼。
谢谢,
NDayave
Yeah, those are all the relationships there are.
whats happening is:
restoring old data with a Child ID of 3
in bookings table the booking is therefore under Child ID of 3
Because you cannot (to my knowledge) change autonumbers, the imported Data is given a new Child ID: 5
The imported booking table however, still holds a Child ID of 3, which is now either non-existant or just wrong. This then stops the import of the booking due to key violations.
On a side note, do you know how to set a text box with an input mask to always start at the left no matter where you click in the text box. Its a little problem but it annoys me.
Thanks,
NDayave
如果这是一个拆分数据库,你可以让备份作为一个整体替换整个后端而不是一次替换一个表。这种方式不会打扰关系或自动编号。
if this is a split database you can have the back up replace the entire backend as a whole rather than a table at a time. that way would not disturb the relationships or autonumbers.
这篇关于Autonumbers无法进行预订备份的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!