Results 1 to 3 of 3

Thread: Connecting to Sql to retrieve data

  1. #1

    Thread Starter
    Lively Member stevebriz's Avatar
    Join Date
    Jul 2006
    Location
    Santiago,Chile
    Posts
    95

    Connecting to Sql to retrieve data

    Hi,
    I never tried to connect to a database before and after reading a few previous posts and googling - I am confused as to the best way to connect to a SQL database to retrieve a single field in one table. ( I just want to get get the value from this field) to use as a status.
    I don't want to update the DB at all just simpy read from it.

    Can somebody point me in the right direction to simply do this?
    An example would be great if possible.

    thanks for you assistance
    Steve

  2. #2
    A SQL Server fool GaryMazzone's Avatar
    Join Date
    Aug 2005
    Location
    Dover,NH
    Posts
    7,493

    Re: Connecting to Sql to retrieve data

    You make a connection to the database (use ADODB Code). Create a recordset. Write SQL Statement to retrieve data from the database. Asign the SQL Statement to the recordset and then open the recordset.

    If the recordset contains data (not at BOF Or EOF) then assigne the returned value to a variable or some other oject on the form.
    Sometimes the Programmer
    Sometimes the DBA

    Mazz1

  3. #3
    Addicted Member
    Join Date
    Nov 2006
    Posts
    170

    Re: Connecting to Sql to retrieve data

    Try looking for a tutorial on ado.
    http://www.vbforums.com/showthread.php?t=153935

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width