Results 1 to 6 of 6

Thread: Coding for DBGrid1

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Sep 2007
    Posts
    19

    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

  2. #2
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    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?

  3. #3

    Thread Starter
    Junior Member
    Join Date
    Sep 2007
    Posts
    19

    Re: Coding for DBGrid1

    hi

    i used the "package and deployment wizard from vb6"

    thanks

  4. #4

    Thread Starter
    Junior Member
    Join Date
    Sep 2007
    Posts
    19

    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

  5. #5
    Super Moderator si_the_geek's Avatar
    Join Date
    Jul 2002
    Location
    Bristol, UK
    Posts
    41,974

    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.

  6. #6

    Thread Starter
    Junior Member
    Join Date
    Sep 2007
    Posts
    19

    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
  •  



Click Here to Expand Forum to Full Width