Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

oledbconnection problem with Fill

Posted on 2013-12-13
2
Medium Priority
?
216 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 75

Accepted Solution

by:
käµfm³d   👽 earned 2000 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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Since .Net 2.0, Visual Basic has made it easy to create a splash screen and set it via the "Splash Screen" drop down in the Project Properties.  A splash screen set in this manner is automatically created, displayed and closed by the framework itsel…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…
Please read the paragraph below before following the instructions in the video — there are important caveats in the paragraph that I did not mention in the video. If your PaperPort 12 or PaperPort 14 is failing to start, or crashing, or hanging, …

610 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