an attempt to attach an auto-named database for file c:\documents and settings\audrey\my documents\msdn\using sql express from visual basic 6\sql express\northwnd1.mdf failed. a database with the same name exists, or specified file cannot be opended, or it is located on unc share
this is the codes
Dim cn As ADODB.Connection
Set cn = New Connection
cn.ConnectionString = "Provider=SQLNCLI.1;Integrated Security=SSPI;" & _
"Persist Security Info=False;" & _
"AttachDBFileName=" & App.Path & "\northwnd1.mdf;Data Source=AUDREY\sqlexpress"
cn.Open
Dim rs As Recordset
Set rs = New Recordset
rs.Open "Select * from orders", cn
Set MSHFlexGrid1.DataSource = rs
by the way i downloaded the sample code here http://msdn.microsof...(v=sql.90).aspx
what i want is i want to learn programming. i know how to connect ms access and my sql. but i can't make it with ms sql
please help me how to solve it
i tried to solve it but i failed. by the way the database is beside the .vbp files
This post has been edited by Atli: 03 February 2012 - 11:08 PM
Reason for edit:: Updated the title for clarity.

New Topic/Question
Reply




MultiQuote






|