Results 1 to 2 of 2
2007-05-30, 13:02 #1
- Join Date
- Jan 2004
- Thanked 0 Times in 0 Posts
Attach db and connect with taht (6.0)
I want to attach the db (present into dir of my project) and after connect it...
Have variuos error.
myserver name "cl259f4500"
no password no user (use sqlexpress free)
Private Sub Command1_Click()
Dim cn As ADODB.Connection
Set cn = New Connection
Dim cOn As ADODB.Connection
Set cOn = New Connection
cn.ConnectionString = "Provider=SQLNCLI.1;Integrated Security=SSPI;" & _
"Persist Security Info=False;" & _
"AttachDBFileName=" & App.Path & "northwnd.mdf;Data Source=CL259F4500"
'cOn = Nothing
cOn.ConnectionString = "Data Source=CL259F4500;Initial Catalog=northwnd;Integrated Security=SSPI;Persist Security Info=False"
Dim rs As Recordset
Set rs = New Recordset
rs.Open "Select * from orders", cn
Set MSHFlexGrid1.DataSource = rs
2007-05-30, 13:14 #2
- Join Date
- Mar 2002
- Thanked 29 Times in 29 Posts
Re: Attach db and connect with taht (6.0)
Sal, I have moved many of your questions about Access/SQL to the Access forum, and now you post another one in the wrong forum. I'm not going to move this one, I'm locking it instead.