0

I have been trying to figure this out for a few days but every time I try and fix it I encounter the same error. I am trying to implement the data from my database into a candlestick style chart.Every time I run it i'm faced with this same error:

"An unhandled exception of type 'System.Data.OleDb.OleDbException' occurred in System.Data.dll

Additional information: IErrorInfo.GetDescription failed with E_FAIL(0x80004005)."

I have used a combination of the limited resources given to me and code that I found here on a previously answered question to create the following code.

Imports System.Data
Imports System.Data.OleDb
Public Class Form1


Dim myConnection As OleDbConnection = New OleDbConnection
Dim provider As String = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source ="
Dim dataFile As String = "C:\Users\Ian\Documents\A2 Woking\Computing\Database1\Database_data_source .accdb"
Dim DatabasePass As String = "DatabasePW"
Dim connString As String = provider & dataFile
Dim execute As OleDbDataReader

Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load

    myConnection.ConnectionString = connString

    Dim objDataAdapter As OleDbCommand = New OleDbCommand("Select Time, Open, High, Low, Last FROM EUR_USD_TB", myConnection)

    myConnection.Open()

    execute = objDataAdapter.ExecuteReader

    While execute.Read
        chartTemplate.Series("dataSeries").Points.AddXY(execute("Time"), execute("Low"), execute("High"), execute("Open"), execute("Last"))
    End While
    ' Close the reader and the connection
    execute.Close()
    myConnection.Close()


End Sub
End Class

Any help would be appreciated i'm sure its something annoyingly simple I don't get.

The path is correct--- The database is not protected by a password, that variable is for later--- The query works in access--- This same code works perfectly for accessing a separate table in my login

user990423
  • 1,397
  • 2
  • 12
  • 32
azt4er
  • 1
  • 2

0 Answers0