SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Site Related Forums
 Article Discussion
 using result set in an array
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

greg85374
Starting Member

USA
8 Posts

Posted - 07/16/2004 :  15:30:37  Show Profile  Send greg85374 a Yahoo! Message  Reply with Quote
Basically I created a custom calendar--it is set up the same was as microsofts calendar(active x control)

the following is all from VB6 NOT vb.net

I created a sqlstatement:
SQLString = "SELECT * FROM TblEmpAttendance WHERE Date = " & SomeDay


The valiable Someday holds all the values(from a loop) for the valid days in the current month and year!

I need to do the following:
Chk which employee(EmployeeID) the user is currently working on
Search the aforementioned table for that employee
Load the data(result set) int a textbox array in my custom calendar
My txtbox array is TxtDate(0) - TxtDate(42) but only 31 MAX are valid
I say MAx cuz there may only be a MAX of 31 days in a month

I tried(To start with):
Private Sub LoadValues()
Dim SQLString, SomeDay As String
Dim StartPoint, StopPoint, I As Integer

'Add Values to textBoxes
For I = 1 To 31 Step 1 'loop only though valid textboxes
SomeDay = MyMonth & "/" & I & "/" & CboYear.Text
SQLString = "SELECT * FROM TblEmpAttendance WHERE Date = " & SomeDay
AdoQuery.RecordSource = SQLString
TxtDate(I).Text = SQLString

Next I

End Sub


Unfortunatley I cant refer to the result AND i have NEVER tried anything like this before-I dont even know where to start!!

Any help would be highly appreciated!!!
Thanks in advance!!
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.05 seconds. Powered By: Snitz Forums 2000