Page 1 of 5 1234 ... LastLast
Results 1 to 10 of 45

Thread: SQL 101

  1. #1

    Default SQL 101


    post your sql scripts here ...

    simple script:
    select * from emp;

    get the date ( Oracle Database )
    select sysdate from dual ;





    ALONE:Hated and Punished

  2. #2

    Default Re: SQL 101

    script for retrieving the sum of a field.

    select sum(amount) from payments

  3. #3

    Default Re: SQL 101

    here's a simple SQL script using view creating an aging report source

    CREATE OR REPLACE VIEW AGING as
    SELECT ClientName,
    SUM(DECODE(TRUNC((ASOF-INVOICEDATE)/30),0,AMOUNT,NULL)) THIS,
    SUM(DECODE(TRUNC((ASOF-INVOICEDATE)/30),1,AMOUNT,NULL)) THIRTY,
    SUM(DECODE(TRUNC((ASOF-INVOICEDATE)/30),2,AMOUNT,NULL)) SIXTY,
    SUM(DECODE(TRUNC((ASOF-INVOICEDATE)/30),3,AMOUNT,NULL)) NINETY,
    SUM(AMOUNT) TOTAL
    FROM INVOICE, ASOF
    GROUP BY CLIENTNAME;

  4. #4

    Default Re: SQL 101

    have any of you guys tried connecting Visual Basic 6 Application with MSSQL 2000 server?


  5. #5

    Default Re: SQL 101

    @kyle
    i have tried conneting VB via ODBC to mySQL but using a lower version.
    Using a connection string pass thru Data Source Name.


  6. #6

    Default Re: SQL 101

    Quote Originally Posted by kyle_nexus
    have any of you guys tried connecting Visual Basic 6 Application with MSSQL 2000 server?
    yup i did it before ... hmmm naahhh its vb6 on MSsql 7 server ... sorry .. why whats the issue with MSsql2000?
    ALONE:Hated and Punished

  7. #7

    Default Re: SQL 101

    ^^^ can u give me the connection code? i can't find the answer of how to connect vb6 w/ mssql 2k in the net.

    i hope the code will also work with mssql2k. thanks.

  8. #8

    Default Re: SQL 101

    &kyle for my inputs...
    there are a lot of ways on how to connect to a database servers using VB. not just mySQL. it depends on how you design your program and which is appropraite for it.
    the ff are some of the ways.
    1. Using ADO (Active X Data Object) - no need to code just define your source of connection
    2. Data Environment (Active X Designer) - no codes , set up your Data Link Properties
    3. ODBC (Open Database Connectivity) - the flexible one , you need code to connect to the database
    via Data source name

  9. #9

    Default Re: SQL 101

    though there are a lot of ways below is a sample connection string to mySQL. Put this in a module
    so that you can access the string anytime. then use connection object reference this string to connect.


    Public Function connectString() As String
    Dim cnStr As String
    'SQL Server using ODBC
    Â* Â*' SQL Server using an ODBC Data Source
    'Â* Â*connectString = "Provider=MSDataShape;" & _
    'Â* Â* Â* Â* Â* Â* Â* Â* Â* Â*"DSN=Phonebook;" & _
    'Â* Â* Â* Â* Â* Â* Â* Â* Â* Â*"UID=root;PWD=;" & _
    'Â* Â* Â* Â* Â* Â* Â* Â* Â* Â*"DATABASE=Pbook"
    'Â* Â*cnStr = connectString

    Â* Â*
    Â* Â*' SQL Server using OLE DB Provider
    Â* Â*'ConnectString = "ProviderÂ* Â* Â* Â* = MSDataShape" & _
    Â* Â*'Â* Â* Â* Â* Â* Â* Â* Â* "Data SourceÂ* Â* Â*= (local);" & _
    Â* Â*'Â* Â* Â* Â* Â* Â* Â* Â* "Initial Catalog = Employees;" & _
    Â* Â*'Â* Â* Â* Â* Â* Â* Â* Â* "User IdÂ* Â* Â* Â* Â*= sa;" & _
    Â* Â*'Â* Â* Â* Â* Â* Â* Â* Â* "PasswordÂ* Â* Â* Â* = ; "
    End Function

  10. #10

    Default Re: SQL 101

    thanks maldito_guapito.

    MySQL and MSSQL are two different things.

  11.    Advertisement

Page 1 of 5 1234 ... LastLast

Similar Threads

 
  1. Guitar 101
    By Carlo Borromeo in forum Music & Radio
    Replies: 74
    Last Post: 11-25-2014, 09:09 PM
  2. .:: Overclocking 101 ::.
    By FK in forum Computer Hardware
    Replies: 1043
    Last Post: 05-27-2008, 07:31 AM
  3. learning (my)sql 101 - B
    By anggwaponi in forum Programming
    Replies: 9
    Last Post: 03-14-2008, 05:56 AM
  4. learning (my)sql 101
    By anggwaponi in forum Programming
    Replies: 16
    Last Post: 02-29-2008, 01:12 PM
  5. SCAM 101 : never give out blank checks
    By SPRINGFIELD_XD_40 in forum Politics & Current Events
    Replies: 14
    Last Post: 06-06-2006, 12:20 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
about us
We are the first Cebu Online Media.

iSTORYA.NET is Cebu's Biggest, Southern Philippines' Most Active, and the Philippines' Strongest Online Community!
follow us
#top