| | |
Help Running SQL thru VB
Please support our Visual Basic 4 / 5 / 6 advertiser: Programming Forums - DaniWeb Sister Site
![]() |
•
•
Join Date: Sep 2007
Posts: 2
Reputation:
Solved Threads: 0
I am making a simple payroll program that keeps track of my hours, jobs, descriptions, etc. It also keeps track of the checks I've gotten. I have three main tables: Hours consisting of date, time started, ended, total hours, customer, job, description, Payperiod number, I know this one could be broken down more but that's not what I'm after right now. The other two are two are Checks and PayPeriod each with a matching index for joining. That part works fine. I'm using Flexgrids for my output. I would like to use a combo box so I can look at individual pay periods(1,2,3, Pay Period Index). After alot of frustration, I finally got what I thought would work but it now tells me Microsoft Jet Engine can't find table check spelling or existence done both don't know why anymore. Here's part of whats written the reason I didn't use * was because I didn't want to show period or index columns
Please Help with as little laughter as possible I did not go to school for this nor am I it is for broadening my horizons and learning I've been reading books and trying to figure it out but as of yet I have not.
Thanks,
Bakedsushi
Visual Basic 4 / 5 / 6 Syntax (Toggle Plain Text)
If cboViews.Text = "By Period" Then If cboPeriod.Text <> "" Then QueryOne = " Select Hours.date,Hours.[time started],hours.[time ended],hours.[hours _ worked],hours.customer,hours.description From Hours where hours.period = '" & _ cboPeriod.Text & "' Order by hours.date desc, hours.[time started] asc" datHours.RecordSource = Chr(34) & QueryOne & Chr(34) datHours.Refresh flxHours.Refresh Else ErrMess = "Please select a period" MsgBox ErrMess End If End If
Thanks,
Bakedsushi
Last edited by bakedsushi; Sep 24th, 2007 at 11:11 pm.
there is simple syntax error in ur code. use the following :-
QueryOne = "Select date,time_started,time_ ended,hours_worked,customer,description From Hours where period='" & _ cboPeriod.Text & "' Order by date desc, time _started asc"
datHours.RecordSource = trim(QueryOne)
**replace all of ur fields that have
space with underscore.**
QueryOne = "Select date,time_started,time_ ended,hours_worked,customer,description From Hours where period='" & _ cboPeriod.Text & "' Order by date desc, time _started asc"
datHours.RecordSource = trim(QueryOne)
**replace all of ur fields that have
space with underscore.**
Last edited by choudhuryshouvi; Sep 25th, 2007 at 1:52 pm.
•
•
•
•
Okay, I tried that now I get another error too few parameters expected 3
use '* from' in your query to fetch all fields from the table. then display value of only those fields which you are wanting.
Regards
Shouvik
![]() |
Similar Threads
- Problem connecting to the database after changing the database server (ASP.NET)
- How do I make my Access database work with MS SQL Server? (MS Access and FileMaker Pro)
- SQL Query Analyzer Problem (Database Design)
- MDB2 SQL Connection (Visual Basic 4 / 5 / 6)
- Setup and Run MSDE. (MS SQL)
- MS-SQL Standard Memory Cap (MS SQL)
- AOL IE wont load and blackice detection (Viruses, Spyware and other Nasties)
- Help With SQL Server Agent (MS SQL)
- 2 Questions: license Installation and Speed (MS SQL)
- Suggestions on what type of programming language would be best for the situation (Computer Science)
Other Threads in the Visual Basic 4 / 5 / 6 Forum
- Previous Thread: using calendar picker from Microsoft calendar control 8.0
- Next Thread: help in SQL *plus and VB6 conection
Views: 1137 | Replies: 4
| Thread Tools | Search this Thread |
Tag cloud for Visual Basic 4 / 5 / 6
6 429 2007 access activex add age append application basic beginner birth c++ calculator cd cells.find click client code college column component connection connectionproblemusingvb6usingoledb copy creat ctrl+f data database datareport date delete dissertations dissertationthesis dissertationtopic edit error excel excelmacro file filename form hardware header iamthwee image inboxinvb internetfiledownload keypress label listbox listview liveperson login looping machine microsoft movingranges number objectinsert open oracle password prime program prompt range-objects readfile reading record refresh remotesqlserverdatabase report retrieve save search sendbyte sites sort sql sql2008 sqlserver struct subroutine table tags textbox time timer urldownloadtofile vb vb6 vb6.0 vba visual visualbasic visualbasic6 web window windows





