If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > Delphi, C etc > connect to MSDE 2000

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 01-15-04, 14:07
ojvm ojvm is offline
Registered User
 
Join Date: Jan 2004
Location: mexico
Posts: 2
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
Reply With Quote
  #2 (permalink)  
Old 01-15-04, 22:20
rnealejr rnealejr is offline
Registered User
 
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.
Reply With Quote
  #3 (permalink)  
Old 01-22-04, 11:19
rami.haddad rami.haddad is offline
Registered User
 
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

Quote:
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
Reply With Quote
  #4 (permalink)  
Old 01-22-04, 20:04
ojvm ojvm is offline
Registered User
 
Join Date: Jan 2004
Location: mexico
Posts: 2
thanks i foun the solution, it was like rnealejr said, thanks again
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On