Labtest.ASP Notes. INSERT STATUS <% mydsn= "websysx" Set conn = Server.CreateObject("ADODB.Connection") conn.open mydsn,"","" %> INSERT STATUS <% mydsn=

Slides:



Advertisements
Similar presentations
Widhy Hayuhardhika NP, S.Kom. Overview of database structure Connecting to MySQL database Selecting the database to use Using the require_once statement.
Advertisements

Data Base. Objective Become familiar with database terminology. Create a project to display data for a single database table. Use a DataGrid control.
Guide to Oracle10G1 Introduction To Forms Builder Chapter 5.
ASP Application Development Session 3. Topics Covered Using SQL Statements for: –Inserting a tuple –Deleting a tuple –Updating a tuple Using the RecordSet.
A Guide to Oracle9i1 Introduction To Forms Builder Chapter 5.
4/8/99 C. Edward Chow Page 1 Active Server Page It is a server-side scripting environment for creating dynamic content. ASP are files with.asp extension,
ASP.NET Database Connectivity I. 2 © UW Business School, University of Washington 2004 Outline Database Concepts SQL ASP.NET Database Connectivity.
1 Pertemuan 09 Database Matakuliah: D0524 / Algoritma dan Pemrograman Komputer Tahun: 2005 Versi:
ASP.NET Programming with C# and SQL Server First Edition Chapter 8 Manipulating SQL Server Databases with ASP.NET.
Introduction To Form Builder
Structured Query Language SQL: An Introduction. SQL (Pronounced S.Q.L) The standard user and application program interface to a relational database is.
Phonegap Bridge – File System CIS 136 Building Mobile Apps 1.
SQL Within PL / SQL Chapter 4. 2 SQL Within PL / SQL SQL Statements DML in PL / SQL Pseudocolums Transaction Control.
What is MySQL? MySQL is a database. The data in MySQL is stored in database objects called tables. A table is a collections of related data entries and.
Chapter 5 Introduction to SQL. Structured Query Language = the “programming language” for relational databases SQL is a nonprocedural language = the user.
CPS120: Introduction to Computer Science Information Systems: Database Management Nell Dale John Lewis.
Interacting With Data Databases.
ActiveX Data Object (ADO) in JavaScript J.L.Wang, Yen-Cheng Chen Dept. of Infomation Management Ming-Chuan University Jan
Database 20/2/12 Connection. 
1 Tutorial 2 ABC Web site. Objective Learning web applications design Conducting assumed business logic online Connecting the Database with the web pages.
Copyright © 2001 by Wiley. All rights reserved. Chapter 10: Advanced Database Operations Revising Vintage Videos Setting RecordSource at run time DBGrid.
LOGO 1 Lab_02: Basic SQL. 2 Outline  Database Tables  SQL Statements  Semicolon after SQL Statements?  SQL DML and DDL  SQL SELECT Statement  SQL.
 SQL stands for Structured Query Language.  SQL lets you access and manipulate databases.  SQL is an ANSI (American National Standards Institute) standard.
INTERNET APPLICATION DEVELOPMENT PRACTICAL ON CONNECTING TO MYSQL.
Databases in Visual Studio. Database in VisualStudio An MS SQL database are built in Visual studio The Name can be something like ”(localdb)\Projects”
2440: 141 Web Site Administration Database Management Using SQL Professor: Enoch E. Damson.
SQL Review Tonga Institute of Higher Education. SQL Introduction SQL (Structured Query Language) a language that allows a developer to work with data.
Introduction to MySQL Lab no. 10 Advance Database Management System.
Web Scripting [PHP] CIS166AE Wednesdays 6:00pm – 9:50pm Rob Loy.
SYST Web Technologies SYST Web Technologies Databases & MySQL.
CPS120: Introduction to Computer Science Lecture 19 Introduction to SQL.
CSCI 6962: Server-side Design and Programming Database Manipulation in ASP.
Intro to DatabasesClass 4 SQL REVIEW To talk to the database, you have to use SQL SQL is used by many databases, not just MySQL. SQL stands for Structured.
Creating PHPs to Insert, Update, and Delete Data CS 320.
How to Connect to Database ODBC (Open Database Connectivity) ADO (ActiveX Data Object) ASP Code To Connect to Database Recordset Object Navigating through.
Open Source Server Side Scripting ECA 236 Open Source Server Side Scripting MySQL – Inserting Data.
Intro to SQL Management Studio. Please Be Sure!! Make sure that your access is read only. If it isn’t, you have the potential to change data within your.
Phonegap Bridge – File System CIS 136 Building Mobile Apps 1.
Information Building and Retrieval Using MySQL Track 3 : Basic Course in Database.
SQL Basic. What is SQL? SQL (pronounced "ess-que-el") stands for Structured Query Language. SQL is used to communicate with a database.
CIS 375—Web App Dev II SQL. 2 Introduction SQL (Structured _______ Language) is an ANSI standard language for accessing databases.ANSI SQL can execute.
Introduction to Databases Queries CS 146. Sample Database: CANDY_CUSTOMER CANDY_PURCHASE CANDY_CUST_TYPE CANDY_PRODUCT.
CIS 375—Web App Dev II SQL. 2 Introduction SQL (Structured _______ Language) is an ANSI standard language for accessing databases.ANSI SQL can execute.
Mauricio Featherman, Ph.D. Washington St. University
SQL Jan 20,2014. DBMS Stores data as records, tables etc. Accepts data and stores that data for later use Uses query languages for searching, sorting,
Chapter Fourteen Access Databases and SQL Programming with Microsoft Visual Basic th Edition.
Oracle10g Developer: PL/SQL Programming1 Objectives SQL queries within PL/SQL Host or bind variables The %TYPE attribute Include queries and control structures.
PHP: MySQL. PHP Connect to MySQL PHP 5 and later can work with a MySQL database using: – MySQLi extension (the "i" stands for improved) – PDO (PHP Data.
Oracle11g: PL/SQL Programming Chapter 3 Handling Data in PL/SQL Blocks.
Database Connectivity What is ADO. What is ADO? ADO is a Microsoft technology ADO stands for ActiveX Data Objects ADO is a Microsoft Active-X component.
CHAPTER 10 PHP MySQL Database
SQL Statements: Queries. Relational Databases Relational Databases organize the data in tables with rows and columns. This is similar to the organization.
CSC 2720 Building Web Applications Accessing MySQL from PHP.
T U T O R I A L  2009 Pearson Education, Inc. All rights reserved Address Book Application Introducing Database Programming.
Source = Table rsObject.Open tablename, Connection Object, CursorType, LockType, adCmdTable Source = Stored Procedure rsObject.Open stored procedure name,
IS2803 Developing Multimedia Applications for Business (Part 2) Lecture 6: Accessing a database with PHP Rob Gleasure robgleasure.com.
MICROSOFT ACCESS – CHAPTER 5 MICROSOFT ACCESS – CHAPTER 6 MICROSOFT ACCESS – CHAPTER 7 Sravanthi Lakkimsety Mar 14,2016.
Programming with Microsoft Visual Basic 2012 Chapter 14: Access Databases and SQL.
COM621: Advanced Interactive Web Development Lecture 11 MySQL – Data Manipulation Language.
CHAPTER 7 DATABASE ACCESS THROUGH WEB
Chapter 5 Introduction to SQL.
Introduction to Web programming
ISC440: Web Programming 2 Server-side Scripting PHP 3
SQL Tutorial.
Lecturer: Mukhtar Mohamed Ali “Hakaale”
Chapter 6 Displaying Your Products
CIS16 Application Programming with Visual Basic
Web Programming Language
Introduction To Structured Query Language (SQL)
Introduction to Web programming
Presentation transcript:

Labtest.ASP Notes

INSERT STATUS <% mydsn= "websysx" Set conn = Server.CreateObject("ADODB.Connection") conn.open mydsn,"","" %> INSERT STATUS <% mydsn= "websysx" Set conn = Server.CreateObject("ADODB.Connection") conn.open mydsn,"","" %>

<% ' retrieve values from form (GET) 2 text fields ' Note we need to put them in quotes for the insert statement ' & is the VB concatentation character ' get the values FirstName =Request.QueryString("FirstName") LastName =Request.QueryString("LastName") Netid =Request.QueryString("Netid") Quote =Request.QueryString("Quote") Operation =Request.QueryString("Operation") Doform =Request.QueryString("Doform")

if Doform <> "False" then %> Use this form to insert, update, delete and query the data base FirstName LastName Netid (Required for all operations) Favorite Quote Insert data Update data Delete this person Find this person <% End If

If Doform = "False" then If Operation = "Insert" then 'SQL INSERT SYNTAX: 'INSERT INTO table_name (column1, column2,...) 'VALUES (value1, value2,....) ' BE CAREFUL numeric fields are not quoted, text fields are ' ' Create the insert statement sql = "INSERT into labtest (FirstName, LastName, Netid, Quote) " sql = sql & "VALUES(" & "'" & FirstName & "'" & "," sql = sql & "'" & LastName & "'" & "," sql = sql & "'" & Netid & "'" & "," sql = sql & "'" & Quote & "')"

' write the insert statement out for debugging response.write " INSERT Statement: " & sql & " " ' execute the insert statement Set rs = Server.CreateObject("ADODB.Recordset") rs.Open sql, conn, 3, 3 Else response.write "Currently only Insert Operations are supported" End If %> <% ' close the connection down conn.close conn="" %>

Some Problems How do I add the new functions? How do I do error checking? Update – –What is the easiest way to allow the user to change a record. Delete – –How can I allow a user to delete multiple records at a time –How do I minimize errors? Query –How does the user specify the query? –What are some options they might want? –Can I pass (link) the results of a query to another operation?

New Functions IF Operation =“DELETE” then –Sql = “DELETE ROW from labtest where Netid=‘” & Netid & “’” –Set rs = Server.CreateObject("ADODB.Recordset") – rs.Open sql, conn, 3, 3 END IF

Error Checking The Result code of the Open statement returns error status The result set has properties that can be checked by Visual Basic

Update Possibilities 1) User specifies all fields 2) User just supplies netid, and a new form is generated with the fields already filled out with existing information 3) User supplies a query, all records satisfying query are returned with fields filled out, user makes changes and resubmits all of the record at once.

Delete Options 1) User supplies netid and indicates DELETE 2) User is provided with a list of all netids and then can delete those they wish. (problems??) 3) User supplies a query, results of query generate a form where user can delete any items.

Other problems What if user wants to insert a “special” character in their Quote. What characters could be a problem? Why? What can you do?