Click here to Skip to main content
15,903,175 members

Comments by Member 11385046 (Top 9 by date)

Member 11385046 6-May-15 4:43am View    
Values are still the same, take a look at the imgur links in my question.
Member 11385046 6-May-15 1:51am View    
I'm not used to working with parameters, so I would like to stick with what I know so far. I'm using an access database and the screenhots are taken from MS Access. The type is set to text though, but as the handeling of the dates is taken care of within VB I don't see the problem there, or could it be ?I'll take a look to sync all the cultures together if it might be bugging because of that.
Current code :
<pre lang="vb">
Case rbnWeekly.Checked 'Weekly mode with Enddate and StartDate
If rbnStartEnd.Checked = True Then
Dim aantal As Integer = txtHerhaling.Text
Dim gebruik As Integer = 0
Dim startDate As Date = Date.Today
Dim endDate As Date = dtpEndDate.Text
Dim currDate As Date = startDate
Do While (currDate < endDate AndAlso gebruik < aantal)
SQL = String.Format("INSERT INTO tblManual (StartDate, EndDate, UniqueID) VALUES (#{0}#, #{1}#, '{2}')", currDate, endDate, id)
scmdRecurrence.CommandText = SQL
Valueee += 1
scmdRecurrence.ExecuteNonQuery()
currDate = currDate.AddDays(7)
gebruik += 1
Loop
MsgBox(Valueee.ToString & " records toegevoegd")
Else 'Weekly mode with x times
Dim aantal As Integer = txtHerhaling.Text
Dim gebruik As Integer = 0
Dim startDate As Date = Date.Today
Dim endDate As Date = startDate.AddDays(aantal * 7)
Dim currDate As Date = startDate
Do While (currDate < endDate AndAlso gebruik < aantal)
SQL = String.Format("INSERT INTO tblManual (StartDate, EndDate, UniqueID) VALUES (#{0}#, #{1}#, '{2}')", currDate, endDate, id)
scmdRecurrence.CommandText = SQL
Valueee += 1
scmdRecurrence.ExecuteNonQuery()
currDate = currDate.AddDays(1)
gebruik += 1
Loop
MsgBox(Valueee.ToString & " records toegevoegd")
End If</pre>
Member 11385046 5-May-15 18:04pm View    
My project is not intended to be used as any kind of website service or something, it will only be used by myself. The problem is that it's still putting out random values, anyone knows a way of fixing this ?
Member 11385046 19-Apr-15 13:55pm View    
Thank you ,that's successful ! So this is for daily occasions so how do I add monthly/weekly/yearly events?
Member 11385046 19-Apr-15 13:25pm View    
The current code does not add anything into the database. Code runs without errors though.

Public Class Form1

Private Sub Recurrence_Click(sender As System.Object, e As System.EventArgs) Handles Recurrence.Click
'Delcareren
Dim cnnRecurrence As New OleDb.OleDbConnection
Dim scmdRecurrence As New OleDb.OleDbCommand
Dim SQL As String
'Connectionstring
cnnRecurrence.ConnectionString = My.Settings._1tabel1ConnectionString
scmdRecurrence.Connection = cnnRecurrence
cnnRecurrence.Open()
'Recurrence
Dim startDate As Date = Date.Today()
Dim endDate As Date = startDate.AddDays(15)
Dim currDate As Date = startDate
Do While (currDate < endDate)
SQL = String.Format("INSERT INTO tblManual (StartDate, EndDate) VALUES (#{0}#, #{1}#)", currDate, endDate)
currDate = currDate.AddDays(1)
Loop
cnnRecurrence.Close()
End Sub
End Class