|
-
Sep 26th, 2007, 11:28 AM
#1
Thread Starter
Junior Member
Coding for DBGrid1
hello all,
i am new to this forum, and have posted two other thread so far and had great help, wanted to thank all of you for that
i am not good in vb6 so i do need further assistance.
I am trying to select 3 fields from the Updater table and write the result into a nother table called Reporting, and i have the codes below, all works fine
Code:
Dim DB As Database
Dim rs As Recordset
Dim rs1 As Recordset
Dim tname As String
Dim strdate As Date
Dim strdate2 As Date
Dim SQL As String
Set DB = OpenDatabase(App.Path & "\Project Light Speed.mdb")
strdate = DateAdd("d", 7, (DTPickerWeek.Value) - 13)
strdate2 = DTPickerWeek.Value
SQL = "delete * from Reporting"
DB.Execute SQL
SQL = "insert into Reporting (Job_ID, PM_Tool, Task_Group, Task_Desc, Market, WBS_Desc, Taper_Code, WC_CLLI, Title, Dater, Work_Autho, LU, DA, Date_Ending) select * from [Updater] " & _
"where Dater >=#" & strdate & "# And Dater <=#" & strdate2 & "# " & _
"And Market='" & combomarket.Text & "' And WBS_Desc='" & combowbs.Text & "'"
'Debug.Print SQL
'Set rs = DB.OpenRecordset(SQL)
DB.Execute SQL
SQL = "UPDATE Reporting SET Date_Ending=#" & strdate2 & "#"
DB.Execute SQL
Right now what i did was to get a crystal report to read the records from table Reporting and display, which works, but when i tried to install it to the server, the server has alot of error for crystal report, to avoid all that, how do i code in vb that if i click a command1 button, all the records that was written into reporting willl be displayed at DBGrid1, please help
joyce
Last edited by Hack; Sep 26th, 2007 at 01:14 PM.
Reason: Added Code Tags
-
Sep 26th, 2007, 01:15 PM
#2
Re: Coding for DBGrid1
Did you package your application using an installation and setup package, and run the resulting Setup.EXE on the server or just copy stuff over?
-
Sep 26th, 2007, 04:29 PM
#3
Thread Starter
Junior Member
Re: Coding for DBGrid1
hi
i used the "package and deployment wizard from vb6"
thanks
-
Sep 26th, 2007, 04:31 PM
#4
Thread Starter
Junior Member
Re: Coding for DBGrid1
Hi
i managed to get the MSFlexGrid1 to work, how do i set the column width at form load , since some of the column are too small to display the results during run time
joyce
-
Sep 26th, 2007, 05:29 PM
#5
Re: Coding for DBGrid1
After you have filled the grid, adjust the size of the columns to suit the contents.. the code isn't as simple as we would like it to be, but I have written a Sub to do the work - which you can get via the 'FlexGrid autosize' link in my signature.
-
Sep 27th, 2007, 10:07 AM
#6
Thread Starter
Junior Member
Re: Coding for DBGrid1
hey
thank you for the help
i will look through your code and try it on
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|