Preview

Student Name

Satisfactory Essays
Open Document
Open Document
624 Words
Grammar
Grammar
Plagiarism
Plagiarism
Writing
Writing
Score
Score
Student Name
Student Name ______
VBScript Database Query Lab Report

Task 4: Write and Run Database Query Program 1
In this scenario, we need to query the Computer database to determine which computers need to be replaced. Our decision will be based on the CPU speed, Number of Processors and the size of the Hard Drive.

In the space provided in your Lab Report document, paste your modified VBScript program and the RUN.

In the table cell below, paste your ComputerReplace.vbs Program

'
' COMMENT: Use 32 bit ODBC Microsoft Access Driver
'
'==========================================================================
'Map Database Share on vLab-PC2 to local drive X:
Set ws = WScript.CreateObject("WScript.Shell") ws.Run "cmd /c net use X: \\vlab-PC2\PC2-Scripts",,True

recordsStr = "" sqlStr = "SELECT Computer,Room_Num,Speed,Num_CPUs,OS_Type,HDD_Size FROM Computers where Num_CPUs = 1 OR Speed < 2.1 OR HDD_Size < 300 order by Room_Num" dataSource = "provider=Microsoft.ACE.OLEDB.12.0;" _
& "data source=X:Computers.accdb"

Set objConnection = CreateObject("ADODB.Connection") objConnection.Open dataSource
Set objRecordSet = CreateObject("ADODB.Recordset") objRecordSet.Open sqlStr , objConnection objRecordSet.MoveFirst ' Display Headers

recordsStr = "Computer Room_Num" & _ " Speed Num_CPUs OS_Type" & _ " HDD_Size" & vbCrLf & _ "=============================================" & vbCrLf

Do Until objRecordSet.EOF recordsStr = recordsStr & objRecordSet.Fields.Item("Computer") & _ vbTab & pad(objRecordSet.Fields.Item("Room_Num"),8) & _ vbTab & objRecordSet.Fields.Item("Speed") & _ vbTab & objRecordSet.Fields.Item("Num_CPUs") & _ vbTab & pad(objRecordSet.Fields.Item("OS_Type"),12) & _ vbTab & objRecordSet.Fields.Item("HDD_Size") & vbCrLf objRecordSet.MoveNext
Loop
objRecordSet.Close objConnection.Close WScript.Echo recordsStr

'Delete Mapped Drive X: ws.Run "cmd /c net use X: /delete",,True

function

You May Also Find These Documents Helpful

  • Good Essays

    Const MSGNOPWORDS2 As String = "There was no protection to " & "workbook structure or windows." & DBLSPACE…

    • 1023 Words
    • 5 Pages
    Good Essays
  • Satisfactory Essays

    This paper will compare and contrast three computers to pitch an idea to upgrade the computers in this organization so that the consumer can help with growth, decrease cost and keep up with the technique. This will go over cost, reliability, and power. In the conclusion you will find the computer that fits the organization.…

    • 474 Words
    • 2 Pages
    Satisfactory Essays
  • Satisfactory Essays

    Student

    • 373 Words
    • 2 Pages

    Enclosed is a report of the activities of the Kobyashi Moru Pet Food, USA Limited for the year ended December 31, 2012.…

    • 373 Words
    • 2 Pages
    Satisfactory Essays
  • Satisfactory Essays

    In this scenario, we need to query the Computer database to determine which computers need to be replaced. Our decision will be based on the CPU speed, Number of Processors and the size of the Hard Drive.…

    • 503 Words
    • 4 Pages
    Satisfactory Essays
  • Satisfactory Essays

    4.08 Percent Yield

    • 231 Words
    • 2 Pages

    Create a data table to record your data from the procedure. Be sure that the data table is neat…

    • 231 Words
    • 2 Pages
    Satisfactory Essays
  • Satisfactory Essays

    Week 4

    • 2217 Words
    • 9 Pages

    In the space provided below, copy and paste your VBScript Program Code. If it doesn’t fit, use the next page for the continuation of your sourcecode program…

    • 2217 Words
    • 9 Pages
    Satisfactory Essays
  • Good Essays

    ict revision part 3

    • 755 Words
    • 3 Pages

    Use evaluation criteria to decide what software and hardware to buy and how it will be used.…

    • 755 Words
    • 3 Pages
    Good Essays
  • Satisfactory Essays

    Student

    • 422 Words
    • 2 Pages

    Details of Present Illness: This is a 44-year-old Hispanic male who I was kindly asked to admit by Dr. Max Hirsch. The patient is status post arthrodesis of the left ankle and has newly diagnosed diabetes and hypertension.…

    • 422 Words
    • 2 Pages
    Satisfactory Essays
  • Good Essays

    ASSIGNMENT 06

    • 886 Words
    • 5 Pages

    f) For each PC, double the amount of RAM and add 20 gigabytes to the amount of hard disk. (Remember that several attributes can be changed by one UPDATE statement.) !…

    • 886 Words
    • 5 Pages
    Good Essays
  • Good Essays

    Student

    • 1295 Words
    • 6 Pages

    Economies of scale are the advantages in average cost reductions that can be achieved through the growth of a plant, firm, or an entire industry. There are various different types of economies of scale, all of which can be grouped together into either internal or external. Internal economies occur within a plant or firm, and external economies are the consequence of the growth of the entire industry or region. Economies of scale are therefore the advantages of a growth. However, we must also consider the disadvantages of a growth (either internal or external), which are known as diseconomies of scale, in order to determine whether small firms derive benefit too.…

    • 1295 Words
    • 6 Pages
    Good Essays
  • Better Essays

    Student

    • 1436 Words
    • 6 Pages

    Unmanned drones are a generational step into military history; however the question whether the uses of these devices are making countries such as the U.S into a ‘Predator nation’ needs to be discussed. To determine this attribute the defining of a ‘Predator nation’ and discussion of the different aspects of the term becomes a key element of the discussion. The research into the American military system is important to see whether the U.S has become paranoid and is now overspending. Observing the countries that have been infiltrated by unmanned drones is essential in piecing together the nature of the UAV (unmanned aerial vehicle). “It’s like living under a bomb that could go off at any time, and it’s the Americans doing it,”. The final aspect intention is why the American people and leaders feel that these Unmanned drones are really necessary and whether the drones are doing more harm than good. “This is a tough call. Drone warfare has done a lot of good for the U.S., and could cause Americans a lot of harm.”. These three viewpoints will draw in the conclusion whether the United Sates is in fact a predator nation.…

    • 1436 Words
    • 6 Pages
    Better Essays
  • Satisfactory Essays

    Student

    • 261 Words
    • 2 Pages

    3. List of further financial due diligence areas to be suggested to Camburn for phase 2 due diligence.…

    • 261 Words
    • 2 Pages
    Satisfactory Essays
  • Good Essays

    Student

    • 475 Words
    • 2 Pages

    Event Planners NY, designers & production team provide a complete service; from initial consultation, concept design, external resourcing, location research, decor production, timeline logistics, through to managing your event on the day itself. Be it an contemporary or traditional private wedding or corporate event, we’ll work with you to give your event exactly the atmosphere you envisage.…

    • 475 Words
    • 2 Pages
    Good Essays
  • Good Essays

    Student

    • 437 Words
    • 2 Pages

    Globalization triggered most of the companies expanded their business around world. Teams are working from different location with this change and have common goals and work structure. Without the time, cost and hazards of travel, groups can now share information, chat, innovate and make decisions together. There are challenges, however, inherent in the virtual team concept. It is difficult to build trust and to manage conflict when team members lack the ability to interact face- to-face. Communication is often more challenging, particularly among global virtual teams, which can also make it more difficult to overcome cultural barriers.…

    • 437 Words
    • 2 Pages
    Good Essays
  • Good Essays

    Crystal Report with Image

    • 551 Words
    • 3 Pages

    Create a dataset using the fields you want to display in crystal report. Define the image field as hexaBinary datatype.…

    • 551 Words
    • 3 Pages
    Good Essays