THE FOLLOWING CODE INSERTS A PARTICULAR DATA INTO THE recordset WHICH IS THE FIRST FORM!!! -
rs.Open "select * from empdetail Where ID='" & txtid.Text & "'", conn, adOpenStatic, adLockOptimistic
-
If rs.EOF Then
-
conn.Execute "insert into empdetail(id,name,whours,rate,otrate) values ('" & txtid & "','" & txtname & "','" & txtwhr & "','" & txtrate & "','" & txtorate & "')"
-
MsgBox "INSERTED NEW RECORDS", vbOKOnly, "ADDING NEW RECORDS"
-
Else
-
THE SECONF FORM CONTAINS A LISTVIEW ,WHICH HAS TO DISPLAY THE RECORDS saved through FORM 1 -
rs.Open "select distinct empdetail.name,saldetail1.id from empdetail,saldetail1 where saldetail1.id = empdetail.id", conn, adOpenStatic, adLockOptimistic
-
If Not rs.EOF Then
-
rs.MoveFirst
-
Do While Not rs.EOF
-
With ListView1
-
Set lvitem = ListView1.ListItems.Add(, , rs!id)
-
lvitem.SubItems(1) = rs!Name
-
rs.MoveNext
-
End With
-
Loop
-
End If
-
rs.Close
-
Set rs = Nothing
-
ListView1.Refresh
-
ListView2.Refresh
-
BUT THAT IS NOT WORKING!~!!!,
the code displays only the first inserted record in ht listview,but htt nexrt added records is not dispalying
PLEASE SUGGEST<THNAKS IN ADVANCE!!!
13 1338
try using this -
conn.begintrans
-
conn.Execute "insert into empdetail(id,name,whours,rate,otrate) values ('" & txtid & "','" & txtname & "','" & txtwhr & "','" & txtrate & "','" & txtorate & "')"
-
conn.commitrans
-
try using this -
conn.begintrans
-
conn.Execute "insert into empdetail(id,name,whours,rate,otrate) values ('" & txtid & "','" & txtname & "','" & txtwhr & "','" & txtrate & "','" & txtorate & "')"
-
conn.commitrans
-
Debasis not working.........
Please go through my code n please suggest......
Nick
Debasis,its not working.........
Please go through my code n please suggest......
Nick
Debasis,its not working.........
Please go through my code n please suggest......
it allows only the first records being added,if we checks form2 that will be displayed,but if we add any records second time it is not displayed
If both of your forms are opened at the same time you need to fresh the recordset in form2 after adding the recods in form1.
If both of your forms are opened at the same time you need to fresh the recordset in form2 after adding the recods in form1.
not two recordsets are opened at the sametime,n tell me how a sql recoredset be refreshed???tell me the code to refersh
NICK
Hello
try this -
if Rs.state =1 then rs.close
-
not two recordsets are opened at the sametime,n tell me how a sql recoredset be refreshed???tell me the code to refersh
NICK
Hi,
After looking at your Code, I feel that, You Query for EmpID, If No Record is found, then You add /Insert One Record. So at any given time, Only one Related EmpID is there in the Detail Table. So the ListView Shows only one Record.. Any kind of Re-Freshing the RecordSet will fetch you only One Record.
You can Cross-Check by Actual Querying the data in the Table
Regards
Veena
try to use this
rs.requery is not working i have tried this,but i dont think there's a option for refreshing in sql...if any please suggest
NICK
Hi,
After looking at your Code, I feel that, You Query for EmpID, If No Record is found, then You add /Insert One Record. So at any given time, Only one Related EmpID is there in the Detail Table. So the ListView Shows only one Record.. Any kind of Re-Freshing the RecordSet will fetch you only One Record.
You can Cross-Check by Actual Querying the data in the Table
Regards
Veena
Veena,i couldnt understand,what u have pointed out and the method suggested"
You can Cross-Check by Actual Querying the data in the Table "
Please explain and the code for adding records are: -
rs.Open "select * from empdetail Where ID='" & txtid.Text & "'", conn, adOpenStatic, adLockOptimistic
-
If rs.EOF Then
-
conn.BeginTrans
-
conn.Execute "insert into empdetail(id,name,whours,rate,otrate) values ('" & txtid & "','" & txtname & "','" & txtwhr & "','" & txtrate & "','" & txtorate & "')"
-
conn.CommitTrans
-
MsgBox "INSERTED NEW RECORDS", vbOKOnly, "ADDING NEW RECORDS"
-
Else
-
'ID Found In DB (Duplicate)
-
MsgBox "Duplicate Entry"
-
End If
-
Nick
Hi,
If you are using Access, Open the Access, and Find how many records are thre in EmpDetail and SalDetail Tables, and ow many of them Match (having same EmpID)
Regards
Veena
Hi,
if you are using Access, Open the Access, and Find how many records are thre in EmpDetail and SalDetail Tables, and ow many of them Match (having same EmpID)
Regards
Veena
Ok,but im using sql server...the same can be done here too???
NICK
Hi,
If you are using SQL Server, Query the table Data in ISQL/W Or Enterprise Manager's Query Tool..
REgards
Veena
Sign in to post your reply or Sign up for a free account.
Similar topics
by: wired |
last post by:
Hi,
I've just taught myself C++, so I haven't learnt much about style or
the like from any single source, and I'm quite styleless as a result.
But at the same time, I really want nice code and I...
|
by: x muzuo |
last post by:
Hi guys,
I have got a prob of javascript form validation which just doesnt work
with my ASP code. Can any one help me out please.
Here is the code:
{////<<head>
<title>IIBO Submit Page</title>...
|
by: Pax S |
last post by:
I need a button that will check (make true) two check boxes (fields)
For the record that has the focus (the record on the form that I am
presently looking at). The two check boxes would be like a...
|
by: Jason |
last post by:
Hi,
I was wondering if any could point me to an example or give me ideas on how
to dynamically create a form based on a database table? So, I would have a
table designed to tell my application...
|
by: Gary |
last post by:
Hello,
I'm hoping someone can shed some light on why my report does not output
the same results as shown in preview mode, which is to move the
position of a check box based on a field value (see...
|
by: David Van D |
last post by:
Hi there,
A few weeks until I begin my journey towards a degree in Computer
Science at Canterbury University in New Zealand,
Anyway the course tutors are going to be teaching us JAVA wth bluej...
|
by: icetalks |
last post by:
have a look at this code , its for logging the user in after checking his UserName and Password.
dim check as boolean = false
...
...
If txtUserName.Text.Length = 0 And txtPass.Text.Length =...
|
by: kirubagari |
last post by:
I want to check the arrangement of data in this order from byte 49 to mFile size(END OF FILE).
04 FF _ _ _ _ _04 FF _ _ _ _ 04 FF _ _.
_ __ 04 FF _ _ _ _ 04 FF _ _ _ _ 04 FF
Actually the values...
|
by: warint |
last post by:
My lecturer gave us an assignment. He has a very "mature" way of
teaching in that he doesn't care whether people show up, whether they
do the assignments, or whether they copy other people's work....
|
by: LilMeechc20 |
last post by:
Hello,
I have a group assignment that I have to do. We have to write a Tic Tac Toe game. One person in my group has managed to write the code for a multiplayer (human -vs- human) game and I...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
| |