Help with tables.

GaDauBac

Member
Local time
Tomorrow, 05:43
Joined
Mar 22, 2021
Messages
42
Hi everybody!
I don't know how to move records with field "Luu" = true from database "QCNB" to database "LuuDuLieuQCNB" with the same table. After that, all the fields that have been moved will be deleted. I have attached the folder containing the database here.
Hope everyone can help me.
Thanks everyone!
 

Attachments

Link the source table to the new dB.
Run a append query.
Then run a delete query.

Backup both dB first. Make the append query a select query first. To Make sure you have the correct data. Though your criteria is simple, I would still do it that way.
 
Working only with the t2_ChiTetHopDong table. I saw that 2 tables are not the same, definitely repeat and the structure of the tables to which you will transfer the data should be one-to-one. Otherwise, you cannot. After providing this, you can run SQL.

SQL:
INSERT INTO tb2_ChiTietHopDong ( SoHD, MaKH, HangMucSP, DVT, ChieuCao, ChieuNgang, ChieuSau, KhoiLuong, SoLuong, DonGia, ThanhTien, ThanhToan, NhanVien, ChucVuNV, GhiChu, Luu ) IN 'C:\Users\AS\Downloads\TestSaveData\TestLuuDuLieu\LuuDuLieuQCNB.accdb'
SELECT tb2_ChiTietHopDong.SoHD, tb2_ChiTietHopDong.MaKH, tb2_ChiTietHopDong.HangMucSP, tb2_ChiTietHopDong.DVT, tb2_ChiTietHopDong.ChieuCao, tb2_ChiTietHopDong.ChieuNgang, tb2_ChiTietHopDong.ChieuSau, tb2_ChiTietHopDong.KhoiLuong, tb2_ChiTietHopDong.SoLuong, tb2_ChiTietHopDong.DonGia, tb2_ChiTietHopDong.ThanhTien, tb2_ChiTietHopDong.ThanhToan, tb2_ChiTietHopDong.NhanVien, tb2_ChiTietHopDong.ChucVuNV, tb2_ChiTietHopDong.GhiChu, tb2_ChiTietHopDong.Luu
FROM tb2_ChiTietHopDong
WHERE (((tb2_ChiTietHopDong.Luu)=True));
 
Thanks everyone. I did it.
When changing to Office 2007 or later, Access used a library other than 2003, so it had to be explicitly declared as using the DAO or ADODB library.
Do not use "Dim As Database", must use Dim db As DAO.Database -
Dim rs As DAO.Recordset
 
Thanks everyone. I did it.
When changing to Office 2007 or later, Access used a library other than 2003, so it had to be explicitly declared as using the DAO or ADODB library.
Do not use "Dim As Database", must use Dim db As DAO.Database - Dim rs As DAO.Recordset
 
Thanks everyone. I did it.
When changing to Office 2007 or later, Access used a library other than 2003, so it had to be explicitly declared as using the DAO or ADODB library.
Do not use "Dim As Database", must use Dim db As DAO.Database -
Dim rs As DAO.Recordset
No, I have used just Dim AS Database in the past, until I knew better, and I use 2007.
 
No, I have used just Dim AS Database in the past, until I knew better, and I use 2007.
It all depends on 1) whether either (ado/dao) libraries are checked in ref's, and 2) which are higher and 3) which libraries share similar objects
Kind of a big ugly mixture.

I have only used ADO for sql server connections/executions, and especially in excel.
 

Users who are viewing this thread

Back
Top Bottom