H
headly
I've embedded the activex chart control on a form. It needs to pull data from
an access database. When hardcoded into properties, the chart works fine, but
I'd like to dynamically be able to pull the data from whatever directory the
file may reside in.
Here's the code that isn't working, thoughts appreciated
'Create variable for connection string less path
Dim strConnection As String
'The access db has the same name as the workbook
strConnection = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" &
Left(ActiveWorkbook.FullName, Len(ActiveWorkbook.FullName) - 4) &
".mdb;Persist Security Info=False;Jet OLEDBatabase Password=;"
frmMain.ChartSpace1.ConnectionString = strConnection
frmMain.ChartSpace1.DataMember = "qryDJIA"
frmMain.ChartSpace1.Refresh
an access database. When hardcoded into properties, the chart works fine, but
I'd like to dynamically be able to pull the data from whatever directory the
file may reside in.
Here's the code that isn't working, thoughts appreciated
'Create variable for connection string less path
Dim strConnection As String
'The access db has the same name as the workbook
strConnection = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" &
Left(ActiveWorkbook.FullName, Len(ActiveWorkbook.FullName) - 4) &
".mdb;Persist Security Info=False;Jet OLEDBatabase Password=;"
frmMain.ChartSpace1.ConnectionString = strConnection
frmMain.ChartSpace1.DataMember = "qryDJIA"
frmMain.ChartSpace1.Refresh