Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Can't update my MYSQL table when it connect with Access

Status
Not open for further replies.

Sasi

Programmer
Aug 3, 2001
1
US
Hi I need some help
I am using Mysql and Access to create db Project. I used MYODBC to connect with access. Everything seems to be working. Everyday When I open my Database the machine has to update some. I wrote the code in VBA. The code seems to be okay but it giving me error that it can't update the database. So can you help me to finish my project.
here is my source code

Dim mintCurrentNextpaymentmonth As Integer
Dim mintCurrentDatemonth As Integer
Dim mintnextNextPaymentmonth As Integer
Dim mintCurrentNextPaymentYear As Integer
Dim mintCurrentyear As Integer
Dim mintCalculatemonth As Integer
Dim mintcurrentNextPaymentday As Integer
Dim strdate As String
Dim second_mintnextNextPaymentmonth As Integer
Dim second_mintNextyear As Integer


' Modify this line to include the path to Northwind
' on your computer.

' Change values in the ReportsTo field to 5 for all
' employee records that currently have ReportsTo
' values of 2.



Me.Recordset.MoveFirst


Do Until Me.Recordset.EOF
mintCurrentNextpaymentmonth = Format(Me.NextPaymentDate, "mm")
mintCurrentDatemonth = Format(Now(), "mm") '
mintcurrentNextPaymentday = Format(Me.NextPaymentDate, "dd")

mintCurrentNextPaymentYear = Format(Me.NextPaymentDate, "yy")
mintCurrentyear = Format(Now(), "yy")
If Now() > Me.NextPaymentDate Then
second_mintnextNextPaymentmonth = mintCurrentNextpaymentmonth + Me.BillingTerm
If second_mintnextNextPaymentmonth >= 12 Then
second_mintnextNextPaymentmonth = second_mintnextNextPaymentmonth - 12
second_mintNextyear = mintCurrentNextPaymentYear + 1
strdate = Str(second_mintnextNextPaymentmonth) + Str(mintcurrentNextPaymentday) + Str(second_mintNextyear)
Me.NextPaymentDate.Value = Format(strdate, "mm/dd/yy")
Else
strdate = Str(mintCurrentNextpaymentmonth) + Str(mintcurrentNextPaymentday) + Str(mintCurrentNextPaymentYear)
Me.NextPaymentDate.Value = Format(strdate, "mm/dd/yy")
End If



Me.Requery
End If





Me.Recordset.MoveNext
Loop

End Sub

I need to submit my project this week
 
I seem to rtemeber I had similar problems when using Access 2000, but when using Access 97 it worked ok, apparently there is/was a glitch with the ODBC integration between Access 2000 and MySQL.

HTH

Nige.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top