VISUAL QUICKSTART GUIDE SQL Second Edition [Electronic resources] نسخه متنی

اینجــــا یک کتابخانه دیجیتالی است

با بیش از 100000 منبع الکترونیکی رایگان به زبان فارسی ، عربی و انگلیسی

VISUAL QUICKSTART GUIDE SQL Second Edition [Electronic resources] - نسخه متنی

Chris Fehily

| نمايش فراداده ، افزودن یک نقد و بررسی
افزودن به کتابخانه شخصی
ارسال به دوستان
جستجو در متن کتاب
بیشتر
تنظیمات قلم

فونت

اندازه قلم

+ - پیش فرض

حالت نمایش

روز نیمروز شب
جستجو در لغت نامه
بیشتر
توضیحات
افزودن یادداشت جدید


"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">








  • Microsoft Access


    Microsoft Access is a commercial desktop DBMS. Access is appropriate for managing small and medium-size databases. You can learn about Access and get a free 30-day trial copy at www.microsoft.com/office/access.

    This book covers Microsoft Access 2003 but also includes tips for earlier versions. To determine which version of Access you're running, choose Help > About Microsoft Access.

    In Access, you must turn on ANSI-92 SQL query mode for a database to run SQL statements that use ANSI-92 SQL syntax (that is, many of the examples in this book).

    To turn on ANSI-92 SQL query mode for a database



    1.

    In Access, open the database if necessary.

    2.

    Choose Tools > Options > Tables/Queries tab.

    3.

    In the SQL Server Compatible Syntax (ANSI 92) section, check the This Database check box (

    Figure 1.1 ).

    Figure 1.1. Check this box to turn on ANSI-92 SQL query mode for the open database.

    4.

    Click OK.

    Access closes, compacts, and then reopens the database before the new setting takes effect.


    Tips

    • In general, be wary of switching between ANSI-89 and ANSI-92 query modes. The modes aren't compatible, so ideally, you should pick a mode when you create a database and never change it. The range of data types, reserved words, and wildcard characters differs by mode, so SQL statements created in one mode might not work in the other.

    • For information about query modes, search for

      ansi sql query mode in Access Help.

    • ANSI-92 mode is compatible with

      Microsoft SQL Server . If you're running

      Access 97 or earlier, you're stuck with ANSI-89 mode.

    If you're a casual Access user, you've probably used the query design grid to create a query. When you create a query in Design View, Access builds the equivalent SQL statement behind the scenes for you. You can view, edit, and run the SQL statement in SQL View.

    To run an SQL statement



    1.

    Open a database, or press F11 to switch to the Database window for the open database.

    2.

    In the Database window, click Queries (below Objects); then click New in the toolbar (

    Figure 1.2 ).

    Figure 1.2. On the toolbar, click the New button to create a new query.

    3.

    In the New Query dialog box, click Design View; then click OK (

    Figure 1.3 ).

    Figure 1.3. Select Design View to skip the hand-holding wizards.

    4.

    Without adding tables or queries, click Close in the Show Table dialog box (

    Figure 1.4 ).

    Figure 1.4. You don't need to add tables graphically because the SQL statement itself specifies the tables.

    5.

    Choose View > SQL View (

    Figure 1.5 ).

    Figure 1.5. SQL View hides the graphical query grid and instead shows a text editor where you can type or paste an SQL statement.

    6.

    Type or paste an SQL statement (

    Figure 1.6 ).

    Figure 1.6. Enter an SQL statement...

    7.

    To run the SQL statement, click on the toolbar or choose Query > Run (

    Figure 1.7 ).

    Figure 1.7. ...and run it.

    Access displays the results of a SELECT statement (

    Figure 1.8 ) but executes other types of statements silently or displays warning messages, depending on your settings.

    Figure 1.8. Access displays the results of a SELECT statement.


    Tip

    • You can run only a single SQL statement through a Query object. To run multiple statements, use multiple Query objects or a host language such as Visual Basic or C#.


    • / 169