| | |
How to insert datas from one table to another using ADO connection
![]() |
•
•
Join Date: Aug 2008
Posts: 5
Reputation:
Solved Threads: 0
Hello
I am using windows XP
I need a small programme in Visual basic 6 with Access 2000
I have two tables for example one table named student other table named section
In student table rno is primary key. In section table Rollno is primary key
Both tables have datas, I want to insert datas from student to section.
The coditions is unique datas only (ie. some datas already in section while inserting
datas from student to section the existing datas should be eliminated they wont be inserted)
( by comparin rno with rollno)
Please me code for inserting tables using ADODB recordset
A.Senthil kumar
I am using windows XP
I need a small programme in Visual basic 6 with Access 2000
I have two tables for example one table named student other table named section
In student table rno is primary key. In section table Rollno is primary key
Both tables have datas, I want to insert datas from student to section.
The coditions is unique datas only (ie. some datas already in section while inserting
datas from student to section the existing datas should be eliminated they wont be inserted)
( by comparin rno with rollno)
Please me code for inserting tables using ADODB recordset
A.Senthil kumar
•
•
Join Date: Jul 2008
Posts: 44
Reputation:
Solved Threads: 3
You can do this in a number of way, one simple way is that,
1. if you want to insert only student whose info is in students table but not in Section table,
then select uisng this SQL
SQL= "SELECT * FROM Student WHERE rno NOT IN(SELECT DISTINCT Rollno FROM section WHERE Student.rno= section.Rollno)ORDER BY rno"
The Above SQL will select only those student which are not in the Section table so that you can insert all the elected list to the Section Table by using AddNew command.
Try this, its so simple. There a number of way for this.
1. if you want to insert only student whose info is in students table but not in Section table,
then select uisng this SQL
SQL= "SELECT * FROM Student WHERE rno NOT IN(SELECT DISTINCT Rollno FROM section WHERE Student.rno= section.Rollno)ORDER BY rno"
The Above SQL will select only those student which are not in the Section table so that you can insert all the elected list to the Section Table by using AddNew command.
Try this, its so simple. There a number of way for this.
![]() |
Other Threads in the Visual Basic 4 / 5 / 6 Forum
- Previous Thread: Date Picker Problem
- Next Thread: Generating words in random letters in a 5x5 dimension textboxes
| Thread Tools | Search this Thread |
* 6 429 2007 access activex add age application basic beginner birth bmp calculator cd cells.find click client code college component connection connectionproblemusingvb6usingoledb copy creat ctrl+f data database datareport date delete dissertations dissertationthesis dissertationtopic edit error excel excelmacro file filename form hardware header iamthwee image inboxinvb internetfiledownload keypress label listbox listview liveperson login looping machine microsoft movingranges number objectinsert open oracle password prime program prompt range-objects readfile reading record refresh remotesqlserverdatabase report save search sendbyte sites sort sql sql2008 sqlserver subroutine tags textbox time urldownloadtofile vb vb6 vb6.0 vba visual visualbasic visualbasic6 web window windows





