Results 1 to 2 of 2
  1. #1
    Join Date
    May 2003
    Posts
    11

    Question Unanswered: How do i connect a SQL2000 db to a VB6 project using ADO?

    What needs to be referenced in order to do this? How do i set the properties on my ADO control for SQL Server 2000 db's?
    Last edited by Sean_Roussel; 06-16-03 at 10:13.

  2. #2
    Join Date
    Feb 2003
    Location
    Montreal, Canada
    Posts
    117

    Re: How do i connect a SQL2000 db to a VB6 project using ADO?

    For the connection object:

    Dim cn as New ADODB.Connection
    cn.ConnectionTimeout = 30 'in seconds
    cn.Provider = "sqloledb"
    cn.Properties("Data Source").Value = sql_server_name
    cn.Properties("Initial Catalog").Value = database_name
    cn.Open

    For de recordset object:

    Dim rcs as New ADODB.Recordset

    rcs.ActiveConnection = cn
    rcs.CursorLocation = adUseServer 'or adUseClient (for local side cursor)
    rcs.CursorType = adOpenStatic 'or adOpenDynamic, adOpenKeyset, adOpenForwardOnly
    rcs.LockType = adLockOptimistic ' or adLockPessimistic, adLockBatchOptimistic, adLockReadOnly

    rcs.Open sql_string_statement



    Originally posted by Sean_Roussel
    What needs to be referenced in order to do this? How do i set the properties on my ADO control for SQL Server 2000 db's?
    Steve

Posting Permissions

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