16,003,315 members
Sign in
Sign in
Email
Password
Forgot your password?
Sign in with
home
articles
Browse Topics
>
Latest Articles
Top Articles
Posting/Update Guidelines
Article Help Forum
Submit an article or tip
Import GitHub Project
Import your Blog
quick answers
Q&A
Ask a Question
View Unanswered Questions
View All Questions
View C# questions
View C++ questions
View Javascript questions
View Visual Basic questions
View .NET questions
discussions
forums
CodeProject.AI Server
All Message Boards...
Application Lifecycle
>
Running a Business
Sales / Marketing
Collaboration / Beta Testing
Work Issues
Design and Architecture
Artificial Intelligence
ASP.NET
JavaScript
Internet of Things
C / C++ / MFC
>
ATL / WTL / STL
Managed C++/CLI
C#
Free Tools
Objective-C and Swift
Database
Hardware & Devices
>
System Admin
Hosting and Servers
Java
Linux Programming
Python
.NET (Core and Framework)
Android
iOS
Mobile
WPF
Visual Basic
Web Development
Site Bugs / Suggestions
Spam and Abuse Watch
features
features
Competitions
News
The Insider Newsletter
The Daily Build Newsletter
Newsletter archive
Surveys
CodeProject Stuff
community
lounge
Who's Who
Most Valuable Professionals
The Lounge
The CodeProject Blog
Where I Am: Member Photos
The Insider News
The Weird & The Wonderful
help
?
What is 'CodeProject'?
General FAQ
Ask a Question
Bugs and Suggestions
Article Help Forum
About Us
Search within:
Articles
Quick Answers
Messages
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
Member 11385046
19-Apr-15 9:19am
View
Thank you,
I have been trying to replace the Console.Writeline command with Oledb commands.
It's not working and giving an error : http://i.imgur.com/WqB1k3v.png
Is there any way of solving this ?
Public Class Manual
Private Sub Manual_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load
'Commands & connections
Dim con As New OleDb.OleDbConnection
Dim cmd As New OleDb.OleDbCommand
Dim Sql As String
con.ConnectionString = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\TonesToDoList\1tabel1.accdb"
con.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 = ("INSERT INTO tblManual (StartDate, EndDate)" & "VALUES ({0}, {1})", currDate, endDate)
cmd.ExecuteNonQuery()
currDate = currDate.AddDays(1)
Loop
con.Close()
End Sub
End Class
Member 11385046
18-Apr-15 19:49pm
View
Thanks for the information, question is updated !
Member 11385046
18-Apr-15 19:44pm
View
I'm currently writing the local program in VB.NET. All the tutorials for recurring dates are either written in C# or ASP.NET.
Member 11385046
18-Apr-15 19:38pm
View
So is there some way of implementing this into VB code ?
Show More