CodeCharge Studio
search Register Login  

Visual PHP Web Development

Visually Create Internationalized Web Applications, Web Reports, Calendars, and more.
CodeCharge.com

YesSoftware Forums -> CodeCharge -> General/Other

 Adding a record to a table thru a button

Print topic Send  topic

Author Message
Sam
Posted: 05/27/2004, 10:23 AM

Hello

I am trying to add a record in a table through the click event; however, it only adds it once. When I go and try to add another record; its dosent' add it..

Private Sub cmdModify_Click()


dim cn as new adodb.connetion
Dim strQry As String
Dim rsEmployeelog As New ADODB.Recordset

cn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Documents and Settings\spatel\My Documents\admissions_b.bak;Jet OLEDB:Database Password=MyDbPassword;"
strQry = "Select * from Emp_Log"
rsEmployeelog.Open strQry, cn, adOpenDynamic, adLockOptimistic

If rsEmployeelog.EOF Then
rsEmployeelog.Close
strQry = "Select * from Emp_Log"
rsEmployeelog.Open strQry, cn, adOpenDynamic, adLockOptimistic

rsEmployeelog.AddNew
rsEmployeelog("Emp_ID").Value = strUserName
rsEmployeelog("SSN").Value = Emp_SSN
rsEmployeelog("Date").Value = Date
rsEmployeelog("PIns_Name").Value = PIns
rsEmployeelog("PIns_Ver_Date").Value = PVar_Date
rsEmployeelog.Update
rsEmployeelog.Close
strQry = "Select * from Emp_Log"
rsEmployeelog.Open strQry, cn, adOpenDynamic, adLockOptimistic
rsEmployeelog.MoveFirst
rsEmployeelog.Close
cn.Close
End If

end sub

Add new topic Subscribe to topic   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

Web Database

Join thousands of Web developers who build Web applications with minimal coding.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.