3
Contributors
4
Replies
5
Views
11 Years
Discussion Span
Last Post by Gowsi
0

Hi friends....


how to connect MS.Acess database into vb.net......

is any ODBC setting needed?

You can connect through oleDB (no ODBC required):

Dim SelectText as String = "Select * from myTable"
 
Dim SqlConn As String = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Inetpub\wwwroot\asp_examples1\test.mdb
 
Dim myDA As oledb.oledbDataAdapter= New oledb.oledbDataAdapter(SelectText, SqlConn)

Ned

0

yes, of course you'll have to make an odbc connection and in your vb.net project you have to download the odbc reference.

To open a database in vb.net:

sconbase = "PROVIDER=MSDASQL;dsn=bdraacp;"
db = New ADODB.Connection
db.CursorLocation = ADODB.CursorLocationEnum.adUseClient
db.Open(sconbase)


the string in dsn it is the odbc connection

be attention to possible errors, please use exceptions to avoid mistakes in the application.

Regards,
Guimas_Boy

0

yes, of course you'll have to make an odbc connection and in your vb.net project you have to download the odbc reference.

Regards,
Guimas_Boy

Guimas provides the method IF you want to use ODBC. The original question was whether or ODBC is required. See my post two above this one - the code I provided is the sum total of what's required to connect without creating an ODBC connection.

Thanks!

Ned

0

Hi NedFrankly...

Thanks. it will work. thank u very much

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.