Hello friends..please help me
I have two identical Tables in my Database (Access) Table 1.Salup , Table 2.Salup1 .
All the fields are identical
My problem is:- I want to copy/append
1. All the records
2. selected Records agreeing certain criteria(eg."Sex=Male") From Table 1 to Table 2. through VB6 code.I started my coding as follows,But I could not succed with it. Set ACRS = New ADODB.Recordset
If ACRS.State = adStateOpen Then ACRS.Close ACRS.Open "SELECT * FROM Salup1", CN, adOpenStatic, adLockOptimistic
mavtcr
-3
Junior Poster
Recommended Answers
Jump to PostTry
Dim qry As String Dim con As New ADODB.Connection con.Open("Driver={Microsoft Access Driver (*.mdb)};" _ & "Dbq=database;Uid=user;Pwd=password;") qry = "INSERT INTO table2 SELECT * FROM table1" con.Execute(qry) con.Close()
If you want specific records then try
qry = "INSERT INTO table2 SELECT * FROM …
Jump to PostWhat are the fields in the tables Salup and Salary? And when you say monthly salary do you mean total or per employee? Please provide an explanation as to what the fields are. The names Dsgn, Doj and Bp are not descriptive.
All 6 Replies
Reverend Jim
4,780
Hi, I'm Jim, one of DaniWeb's moderators.
Moderator
Featured Poster
mavtcr
-3
Junior Poster
Reverend Jim
4,780
Hi, I'm Jim, one of DaniWeb's moderators.
Moderator
Featured Poster
mavtcr
-3
Junior Poster
Reverend Jim
4,780
Hi, I'm Jim, one of DaniWeb's moderators.
Moderator
Featured Poster
mavtcr
-3
Junior Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.