Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsVB SyntaxEnterprise DevelopmentDatabase AccessControlsCOMWin APICrystal ReportDeploymentGeneralGeneral 2
Related Topics
VB.NET / ASP.NETMS SQL ServerMS AccessOther Database ProductsMore Topics ...

VB Forum / Database Access / September 2003



Tip: Looking for answers? Try searching our database.

Using ADO to connect to SQL(MSDE)

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Matt Giblin - 27 Sep 2003 17:47 GMT
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
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.