Database
  Home arrow Database arrow Page 4 - Creating Database Projects with SQL Anywhe...
ASP Free Forums 
.NET  
ASP  
ASP Code  
ASP.NET  
ASP.NET Code  
BrainDump  
C#  
Code Examples  
Database  
Database Code  
IIS  
Microsoft Access  
MS SQL Server  
Visual Basic.NET  
Windows Scripting  
Windows Security  
XML  
ASP Web Hosting  
ASP.NET Web Hosting 
Mobile Linux 
App Generation ROI 
Windows Web Hosting
 
IBM® developerWorks 
Sun Developer Network 
Weekly Newsletter
 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
DATABASE

Creating Database Projects with SQL Anywhere Studio, Part 2
By: Jayaram Krishnaswamy
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 4 stars4 stars4 stars4 stars4 stars / 11
    2005-02-21

    Table of Contents:
  • Creating Database Projects with SQL Anywhere Studio, Part 2
  • Integrated Login
  • Importing ASA data into an Excel worksheet
  • Creating a VB application
  • An example of ADO.NET application

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
    ADVERTISEMENT


    Creating Database Projects with SQL Anywhere Studio, Part 2 - Creating a VB application


    (Page 4 of 5 )

    There are several ways to create a data project within VB 6.0. The method demonstrated here is one of rapidly prototyping the application. Start Adaptive Server Anywhere as discussed earlier (double clicking the shortcut in the Start->Programs). Start a vb Standard Exe project. From main menu->Project, click and select AddDataEnvironment. This adds an icon DataEnvironment1 to the DataEnvironment objects pane and an item(Connection1) to the Project folder as shown in the next two pictures.

    Creating Database Projects with SQL Anywhere Studio, Part 2

    Creating Database Projects with SQL Anywhere Studio, Part 2

    Right Click the Connection1 in the Designer's pane and view its properties. It opens up the Data Link Properties with Microsoft OLEDB for ODBC as the provider.

    Creating Database Projects with SQL Anywhere Studio, Part 2

    In the Connection tab of the Data Link properties, you should be able to pick up Asa 9.0 Sample; for the authentication, use dba for User Name and sql for password. Test the connection.

    Creating Database Projects with SQL Anywhere Studio, Part 2

    Creating Database Projects with SQL Anywhere Studio, Part 2

    The connection string can now be seen in the Connection1's property window, reproduced here: Provider=MSDASQL.1;Persist Security Info=False;User ID=dba;Data Source=ASA 9.0 Sample

    Now right click the Connection1 in the Designer's plane and pick AddCommand. This adds a default Command1 (you may rename most of the defaults).

    Creating Database Projects with SQL Anywhere Studio, Part 2

    Right click the Command1 added, to view its properties. It opens up Command1's properties page window with six tabs: General, Parameters, Relation, Grouping, Aggregates, and Advanced. The Connection text box will be showing Connection1. The Command Name text box will be showing the Command1 you are trying to set up.

    For the Source of Data object's drop down list, you have couple of choices: Stored Procedures, Table, View, and Synonym. For the chosen database object the next drop-down shows the object Name. Should your choice be Tables, the drop down shows all the tables, etc. If you want to write your own SQL statement, then you choose the SQL Statement Radio button. From here on, either you can type in the statement, or build the statement using the query builder, a builder that can be accessed from within VB. In this particular case, since this article is not a tutorial on how to build queries or create a complete application, a table database object is chosen for simplicity.

    Creating Database Projects with SQL Anywhere Studio, Part 2

    Finally, highlight the Command1 object in the designer's plane and drag it on to form1. The whole table with all the columns will be placed on the form.

    Creating Database Projects with SQL Anywhere Studio, Part 2

    Now add a button to the bottom of this form with Caption as "Next", and Name as cmdNext. To the click event of the cmdNext button add the following code:

    Private Sub cmdNext_Click()
    If Not DataEnvironment1.rsCommand1.EOF Then
    DataEnvironment1.rsCommand1.MoveNext
    End If
    End Sub

    Now save the project and run. With this, the rows in the table can be moved in the "Next" direction. You could add other buttons to create a navigation set, or you can add buttons and code to manipulate the data in the database. Since this is only an example of connecting to Adaptive Server Anywhere, only the steps necessary to create a single movement are shown.

    Creating Database Projects with SQL Anywhere Studio, Part 2

    More Database Articles
    More By Jayaram Krishnaswamy


     

    DATABASE ARTICLES

    - Excel Reference
    - Database Programming in C# with MySQL : Usin...
    - Formatting Techniques for Data Access from E...
    - Data Access from Excel VBA
    - Generating a Multiple Table Crystal Report u...
    - ADO and the Command Object
    - On Wiring Up an ADO Data Control
    - Reading and Writing to Files on the Intranet
    - Using ADO Record to Create and Navigate Intr...
    - Using Data Access Pages to Access Data on a ...
    - Using ADO with the SQL Native Client
    - ADO`s Stream Object
    - Opening a Record Object Referencing an Open ...
    - Introducing Jasper (SQL Anywhere 10 Beta)
    - Creating a Database Project in VS 2005

     
    Application Delivery: Everything You Wanted to Know, but Didn`t Know You Needed to Ask
    A comprehensive guide to examining the topics of Wide-area Data Services and app....

     
    Best Practices: Safe and Secure Hardware Asset Recovery
    Companies increasingly must meet EPA and local requirements for the disposal of ....

     
    Managing SSL Security in Multi-Server Environments
    Read this white paper to learn how to simplify management of your organization's....

     
    Open Source Security Myths
    Open Source Software (OSS) is computer software whose source code is available t....

     
    Power and Cooling Capacity Management for Data Centers
    This paper describes the principles for achieving power and cooling capacity man....

     




    © 2003-2008 by Developer Shed. All rights reserved. DS Cluster 1 hosted by Hostway
    Stay green...Green IT