Opening an acess database

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have been programming in years in VVB-5-6 but can anyone help in the syntax
in how to open an access database with a password and how to get a recordset
from it as I am only used to the DAO method and this does not seem to be used
in .net
 
I suggest you visit Carl Prothman's connection string site to get an
appropriate connection string. http://www.able-consulting.com/ADO_Conn.htm


--
____________________________________
William (Bill) Vaughn
Author, Mentor, Consultant
Microsoft MVP
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.
__________________________________
 
hi
to open a connection do this

Imports System.Data.OleDb
....
Dim oOleDbConnection As OleDbConnection
Dim sConnString As String = _
"Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=C:\myPath\myJet.mdb;" & _
"User ID=Admin;" & _
"Password="
oOleDbConnection = New OleDb.OleDbConnection(sConnString)
oOleDbConnection.Open()

As you dont seem to have any idea of ADO.NET, please go thru this article
and find out the apropriate method to fetch data(Record sets are not there in
ado.net )

either you can go for a datareader or a dataset to fetch records


http://www.sitepoint.com/article/introduction-ado-net



regards
Ansil
 
In addition to the other good advice you've received in this thread,
I'd suggest ditching the database password. All it does is give you a
false sense of security and complicate data access code. Anyone
capable of performing a google search can easily bypass it.

--Mary
 
Back
Top