CodeCharge Studio
search Register Login  

Web Reports

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

YesSoftware Forums -> CodeCharge -> General/Other

 Help!! Its only adding one record to a table

Print topic Send  topic

Author Message
spatel

Posts: 10
Posted: 06/01/2004, 10:34 AM

Hello!!

I am trying to create a log table which keeps tracks of all the modifications; however, its only adding one record to a table when I hit Modifty. When I try to modify other record and hit modify; it doesnt add it to the table..


Table: Emp_Log
Fields: Log_ID (PK), Emp_ID, SSN, Date, PIns_Name, PIns_Ver_Date

Private Sub Modify_Click()

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.MoveLast
rsEmployeelog.Close
cn.Close

End If



End Sub
View profile  Send private message
Stefan Hogedal
Posted: 07/04/2004, 1:56 PM

Is Log_ID a counter?

"spatel" <spatel@forum.codecharge> skrev i meddelandet
news:1540bcbe3cb0364@news.codecharge.com...
> Hello!!
>
> I am trying to create a log table which keeps tracks of all the
modifications;
> however, its only adding one record to a table when I hit Modifty. When I
try
> to modify other record and hit modify; it doesnt add it to the table..
>
>
> Table: Emp_Log
> Fields: Log_ID (PK), Emp_ID, SSN, Date, PIns_Name, PIns_Ver_Date
>
> Private Sub Modify_Click()
>
> 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.MoveLast
> rsEmployeelog.Close
> cn.Close
>
> End If
>
>
>
> End Sub
>
> ---------------------------------------
> Sent from YesSoftware forum
> http://forums.codecharge.com/
>


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.

PHP Reports

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


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