Results 1 to 4 of 4
  1. #1
    Join Date
    Jan 2004
    Location
    mexico
    Posts
    2

    Unanswered: connect to MSDE 2000

    how can i connect to MSDE i'm trying this
    -------------------
    With cnContraseña
    .Provider = "SQLOLEDB"

    .ConnectionString = "UID=" & Usuario & ";pwd=" & Password & " ;Database=OVAZQUEZ\Asistencias;Server=ovazquez;Pro vider=SQLOLEDB;"
    .ConnectionTimeout = 5
    .CommandTimeout = 5
    .Open
    End With
    -----------------

    AND THIS

    -----------------------

    With cnContraseña
    .Provider = "SQLOLEDB"
    .ConnectionString = "Data Source =localhost; Initial catalog = Asistencias; User ID =" & Usuario & ";pwd=" & Password

    .ConnectionTimeout = 5
    .CommandTimeout = 5
    .Open
    End With
    ------------------------

    but nothing works, only get a message "ConnectionOpen Error -2147467259 the sql server does not exist" the code is VB 6.0, THANKS

  2. #2
    Join Date
    Feb 2002
    Posts
    2,232
    It probably is not working because you are not using the named instance - however, when troubleshooting a connection problem do the following:

    add the ado data control component
    add a ado data control to your form
    click on properties -> connectionstring -> use connection string -> build... ->
    Chose the parameters and click test connection.
    Copy and paste the connection string into your code.

  3. #3
    Join Date
    Jan 2004
    Posts
    184

    Re: connect to MSDE 2000

    Try this:

    cn.Provider = "SQLOLEDB"
    cn.Properties("Initial Catalog").Value = sDatabase
    cn.Properties("Data Source").Value = sServer
    If IntegratedSecurity Then
    cn.Properties("Integrated Security").Value = "SSPI"
    Else
    cn.Properties("User ID").Value = sUserName
    cn.Properties("Password").Value = sPassword
    End If

    On Error Resume Next
    cn.Properties("Connect Timeout").Value = TIMEOUT_CONNECT
    cn.Properties("General Timeout").Value = TIMEOUT_COMMAND
    cn.Properties("Persist Security Info").Value = False
    cn.ConnectionTimeout = TIMEOUT_CONNECT
    cn.open

    Also this is a very useful control:
    http://www.geocities.com/scirocco_ha/DataControl.htm

    Originally posted by ojvm
    how can i connect to MSDE i'm trying this
    -------------------
    With cnContraseña
    .Provider = "SQLOLEDB"

    .ConnectionString = "UID=" & Usuario & ";pwd=" & Password & " ;Database=OVAZQUEZ\Asistencias;Server=ovazquez;Pro vider=SQLOLEDB;"
    .ConnectionTimeout = 5
    .CommandTimeout = 5
    .Open
    End With
    -----------------

    AND THIS

    -----------------------

    With cnContraseña
    .Provider = "SQLOLEDB"
    .ConnectionString = "Data Source =localhost; Initial catalog = Asistencias; User ID =" & Usuario & ";pwd=" & Password

    .ConnectionTimeout = 5
    .CommandTimeout = 5
    .Open
    End With
    ------------------------

    but nothing works, only get a message "ConnectionOpen Error -2147467259 the sql server does not exist" the code is VB 6.0, THANKS

  4. #4
    Join Date
    Jan 2004
    Location
    mexico
    Posts
    2
    thanks i foun the solution, it was like rnealejr said, thanks again

Posting Permissions

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