Hi All,
In administrative Tools ODBC Data Sources (64-bit) configuration ,Please find the attached screenshot where i have a datasource configured.
Example:
Standarad Part Library 32/64 -bit Server
Standarad Part Library0904 32/64 -bit Microsoft Access Driver (*.mdb)
How to establish connection for both SQL Server and Microsoft Access Driver in VB .net or C#
connection to sqlserver or MDB anyone item at a time.
Please help me.
Thanks & Regards,
Sampath
What I have tried:
Dim MyConnection As System.Data.OleDb.OleDbConnection
Dim DtSet As System.Data.DataSet
Dim MyCommand As System.Data.OleDb.OleDbDataAdapter
Dim DatabasePath As String = "C:\Wdir\MDB\DXEXP_UK.mdb;"
Dim ConnString As String = "Provider=Microsoft.ACE.OLEDB.12.0;" & "Data Source=Standard;UID=user;PWD=password" & "Persist Security Info=False"
Dim SchemaTable As DataTable
'Connect to the database
Dim conn As New System.Data.OleDb.OleDbConnection(ConnString)
Try
conn.Open()
SchemaTable = conn.GetOleDbSchemaTable(System.Data.OleDb.OleDbSchemaGuid.Tables, New Object() {Nothing, Nothing, Nothing, Nothing})
Dim int As Integer
For int = 0 To SchemaTable.Rows.Count - 1
If SchemaTable.Rows(int)!TABLE_TYPE.ToString = "TABLE" Then
MsgBox(SchemaTable.Rows(int)!TABLE_NAME.ToString())
conn.Close()
Exit For
End If
Next
Catch ex As Exception
MessageBox.Show(ex.Message.ToString(), "Data Load Error", MessageBoxButtons.OK, MessageBoxIcon.Exclamation)
End Try