Results 1 to 2 of 2

Thread: ODBC

  1. #1

    Thread Starter
    New Member
    Join Date
    Sep 1999
    Location
    Singapore
    Posts
    8

    Angry

    Hi!

    I was trying to open a SQL Server database from VB5.0.

    1. Created a DSN

    2. Using Opendatabase method, opened the database

    3. Using Openrecordset method, i was trying to open a table in the SQL Server database

    This gives an error saying,"Not a valid Stored procedure". then, i tried opening a stored procedure. But, i couldn't open a stored procedure also.

    Anyone can help me to open a table(SQL Server) from VB5.0

    Thanks in advance

    Regards
    smrenga

  2. #2
    Addicted Member ShIzO's Avatar
    Join Date
    Apr 1999
    Location
    Bartlett, IL
    Posts
    189
    are u using ADO or RDO?

    in ADO:

    Code:
    Dim cn as new Connection
    Dim rs as new Recordset
    
    cn.open "<your connection string goes here>"
    
    set rs = cn.Execute("<your SQL code to retrieve a recordset goes here>")
    
    Do While Not rs.eof
    .
    .<here you manipulte data on "by row" basis>
    .
    .
    rs.MoveNext
    Loop

    ps. you said you want to open table: you don't open table - you open connection and get the recordset from the table.


    email me if you have any questions

    www.HardFind.com -buy/sell/trade your used hardware.

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