|
-
January 10th, 2006, 12:00 AM
#1
connecting with SQL Server
hi experts
i have a little problem for u
I have never connected my project with SQL Server
I want to use my project with multiple databases prepared in SQL Server2000. I am using the following code to connect
_______________________________________________________
Private Sub Command1_Click()
Dim cn As ADODB.Connection
Dim rs As ADODB.Recordset
Dim sSql As String
Set cn = New ADODB.Connection
' Establish a connection to database
'-----------------------------------
With cn
.Provider = "sqloledb"
' Database connection (replace server2003 with your servername)
'-------------------------------------------------------------
.ConnectionString = "Data Source=server2003;Initial Catalog=Northwind;Integrated Security=SSPI;Persist Security Info=False;"
.Open
End With
End Sub
_______________________________________
but I am not able to connect, neither I get any error message nor I am getting connected.
My sql server is protectd by user id and password also.
Please help me.
I am waiting
shiv
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|