I'm new to VB and database programing but I have a project
that needs to use SQL(MSDE). Using ADO to connect what
connection string do I use? Also, if the database (SQL
(MSDE)) is installed locally what would the database path
be.
Thanks in advance,
Matt
William (Bill) Vaughn - 27 Sep 2003 18:48 GMT
The connection string needs to address the instance of the MSDE server that
you installed. You don't need to know the path to the database file as this
detail is handled by the server. If MSDE is the only SQL Server installed,
you can use "." or "(local)" as the server\instance name.
A typical MSDE connection operation looks like this:
Dim cn As ADODB.Connection
Dim cmd As ADODB.Command
Dim rs As ADODB.Recordset
Private Sub Form_Load()
Set cn = New ADODB.Connection
cn.Open "provider=sqloledb;data source=betav9\myMSDEInstance;initial
catalog=biblio;integrated security=sspi"
Another approach is to use a LoginID and Password registered with the MSDE
engine.
In this case I'm using "mixed mode" security which is not enabled by default
with MSDE.
cn.Open "provider=sqloledb;data source=betav9\myMSDEInstance;initial
catalog=biblio", "admin", "pw"
I would search the archives (use Google) for the subtle aspects of enabling
mixed mode security if that's what you need. The
microsoft.public.sqlserver.msde newsgroup has more information as well.
I also suggest picking up one of the books on the subject. Mine discusses
both ADO classic and ADO.NET. See my web site for details.
hth

Signature
____________________________________
Bill Vaughn
MVP, hRD
www.betav.com
Please reply only to the newsgroup so that others can benefit.
This posting is provided "AS IS" with no warranties, and confers no rights.
__________________________________
> I'm new to VB and database programing but I have a project
> that needs to use SQL(MSDE). Using ADO to connect what
[quoted text clipped - 5 lines]
>
> Matt
Val Mazur - 30 Sep 2003 03:12 GMT
Hi Matt,
MSDE is not an Access-type of the database. It does not require any path.
MSDE is just a light version of SQL Server and uses exact same connection
string as SQL Server does. Next link has good examples of connection strings
http://www.able-consulting.com/MDAC/ADO/Connection/OLEDB_Providers.htm#OLEDBProv
iderForSQLServer

Signature
Val Mazur
Microsoft MVP
Check Virus Alert, stay updated
http://www.microsoft.com/security/incident/blast.asp
> I'm new to VB and database programing but I have a project
> that needs to use SQL(MSDE). Using ADO to connect what
[quoted text clipped - 5 lines]
>
> Matt