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

    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
  • 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
  • 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
  • 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
  • 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
  • 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

    • 725 Words
    • 3 Pages

    This famous case established the civil law tort of negligence and obliged manufacturers to have a duty of care towards their customers. The events of the complaint took place in Scotland on Sunday evening on 26th August 1928, when Ms May Donoghue (Appellant) was given a bottle of ginger beer, purchased by a friend. The bottle was later discovered to contain a decomposing snail. Since the bottle was not of clear glass, Donoghue was not aware of the snail until she had consumed most of its contents. She later fell ill and was diagnosed with gastroenteritis by a doctor. Donoghue subsequently took legal action against the manufacturer of the ginger beer, Stevenson. She lodged a writ in the Court of Sessions (Scotland’s highest civil court) seeking £500 damages.…

    • 725 Words
    • 3 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

    student

    • 712 Words
    • 2 Pages

    To begin with, what does motivation mean? According to the business dictionary article, “motivation is an internal and external factor that stimulates desire and energy in people to take action” (Business Dictionary). In other words, motivation is what causes humans to act in a particular way. Moreover, it appeals the social, emotional, and mental forces that stimulate a particular behavior. In this essay, I will be writing about how scientists for BAT industries, one of the world’s biggest cigarette makers, were inventing ways to make it harder for people to stop smoking by innovating new substances to make their cigarettes worth buying.…

    • 712 Words
    • 2 Pages
    Good Essays
  • Good Essays

    Student

    • 615 Words
    • 3 Pages

    The primary communication challenges in the way this announcement was made is lack of communication skills. The vague response of the speaker caused misinterpretation of the message being delivered. Presumably, lack of appropriate non-verbal cues and eye contact caused the managers to misunderstand the message and make assumptions about Mr. Olsen 's response. It was an example of downward communication.…

    • 615 Words
    • 3 Pages
    Good 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

    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