Solved

oledbconnection problem with Fill

Posted on 2013-12-13
2
203 Views
Last Modified: 2013-12-20
Dim weekcounter, savehours As Integer
        Dim insertstatement, saveweekcount As String
        'FIRST QUERY WAGEWEEK FOR COUNTER FOR FIRST DAY OF MONTH
        Dim dtNow As Date = Date.Now
        Dim savedate As Date
        Dim dtFirstOfMonth As Date = dtNow.AddDays(-dtNow.Day + 1)
        Dim dt As Date = Date.Parse(dtFirstOfMonth)
        Dim dateString = dt.ToShortDateString()
        Dim Con As OleDbConnection = New OleDbConnection("Provider=Microsoft.ACE.OLEDB.12.0;Jet OLEDB:Database Password=;Data Source = c:\wages.accdb")
        Dim Dad As OleDbDataAdapter = New OleDbDataAdapter("Select * from WAGEWEEK where WORKDATE =  '" & dateString & " ' ", Con)
        Con.Open()

        ' Create a Data Set
        Dim Dst As DataSet = New DataSet

        ' Fill the Database
'keeps telling me that there is a parameter missing, but there one missing
'if there is a problem with query would I get this error?
        Dad.Fill(Dst)  
        saveweekcount = Dst.Tables(0).Rows(0).Item(1)
        Con.Close()
0
Comment
Question by:javagair
2 Comments
 
LVL 75

Accepted Solution

by:
käµfm³d   👽 earned 500 total points
ID: 39718152
Try this modfication:

Dim Dad As OleDbDataAdapter = New OleDbDataAdapter("Select * from WAGEWEEK where WORKDATE =  #" & dateString & "#", Con)

Open in new window

0
 

Author Closing Comment

by:javagair
ID: 39732820
it was the # from shortdate that caused the problem
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Introduction When many people think of the WebBrowser (http://msdn.microsoft.com/en-us/library/2te2y1x6%28v=VS.85%29.aspx) control, they immediately think of a control which allows the viewing and navigation of web pages. While this is true, it's a…
Microsoft Reports are based on a report definition, which is an XML file that describes data and layout for the report, with a different extension. You can create a client-side report definition language (*.rdlc) file with Visual Studio, and build g…
Windows 10 is mostly good. However the one thing that annoys me is how many clicks you have to do to dial a VPN connection. You have to go to settings from the start menu, (2 clicks), Network and Internet (1 click), Click VPN (another click) then fi…
Internet Business Fax to Email Made Easy - With  eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, f…

920 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now