Read from MSAccess linked table

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



Hi,

Trying to read data from MsAccess, everything OK except accessing a linked
table, then an error occurs: "ODBC--connection to 'myDb' failed". Here is
the code that fails:
________________
Dim connectStr As String = "C:\myDb.mdb"

myConnection = New
OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Mode=Read;Data Source=" &
connectStr)

Dim cmd As OleDbCommand
Dim rd As OleDbDataReader
Dim query As string = "SELECT ID FROM linkedTable"

cmd = New OleDb.OleDbCommand(query, myConnection)
cmd.Connection.Open()
rd = cmd.ExecuteReader(CommandBehavior.Default) 'FAILS...

_______________________________

Any idea how to read from linked tables?

TIA,
Gerard


.



Relevant Pages

  • Re: How to fill DataSet from stored procedure?
    ... Dim cmd As New OleDb.OleDbCommand ... cmd.Connection = MyConnection ... OHM (Terry Burns) ...
    (microsoft.public.dotnet.languages.vb)
  • Re: Data base insert Error HELP!
    ... "An unhandled exception of type 'System.Data.OleDb.OleDbException' ... Dim strSQL As String ... Dim cmd As OleDbCommand ...
    (microsoft.public.dotnet.languages.vb)
  • Fields with mixed string/number data
    ... I am using ADO.Net to extract data from a table in an Excel workbook. ... there is a measurement. ... Dim cmd As OleDbCommand = New OleDbCommand _ ...
    (microsoft.public.data.ado)
  • Data base insert Error HELP!
    ... Private Sub btnAdd_Click(ByVal sender As System.Object, ... Dim strSQL As String ... Dim cmd As OleDbCommand ...
    (microsoft.public.dotnet.languages.vb)
  • How to excute a MS Access Stored procedure?
    ... I have create a MS Access Stored procedure using the code below and no error ... Dim cmd As OleDbCommand ... And now I want to call the Stored procedure with OleDBCommand. ... Dim oCmd As New OleDbCommand ...
    (microsoft.public.dotnet.framework.adonet)