VB and SQL RRS feed

  • Question

  • I am new to programming and using VB and SQL, however i have been tasked to create a from within VB to schedule jobs to be completed throughout the night so we can track what has been completed, by whom and when and any comments that have been in regard to the work been carried out, so i have created an SQL database since we use SQL in house a lot it seemed sensible to use it since we have servers hosting SQL databases. the issue i have is that i can insert, update and delete into and from both tables however if i have created a data table displaying both table in a datagridview and linked both tables with the JobID column the problem occurs and i get a little lost when i have to complete a job that is not in ascending order so i have 6 jobs in Scheduled Work table if i insert or update the Competed table it either adds a new row going to 7 or updates an existing one which is ok but if i want to complete job 5 before 7 am i not sure what the statement should be as this would have to be an insert statement that would reference the JobID column seen as this is the primary key on both tables.

    Sunday, February 9, 2020 3:40 AM

All replies

  • This is a C++ forum, not a VB forum.
    Sunday, February 9, 2020 6:00 PM
  • Hi Penners2003,

    Thank you for posting here.

    According to your description, I need more information to make a test.

    >>but if i want to complete job 5 before 7 am i not sure what the statement should be

    Could you provide some related code and more information about your tables here? It will help us to analyze your problem.

    We are waiting for your update.

    Best Regards,

    Xingyu Zhao

    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact

    Monday, February 10, 2020 6:20 AM
  • Visual Basic makes use of Structured Query Language (SQL) to create new dynasets. SQL is an Industrial Standard language for processing relational

    Visual Basic makes use of SQL to create new recordsets. Set the information controls RecordSource belongings to an SQL query and execute a Refresh method

    Visual Basic uses SQL to select fields and facts from a table and be a part of the fields from row tables.

    allow you to use VB to create custom control tools for SQL Server.

    Because you could control SQL Server from VB, you may without problems develop custom SQL Server control features. And if you use DMO from VB, you could without problems build equipment that streamlines some features that SQL Server's graphical Administration tool provides.
    Monday, February 10, 2020 6:37 AM