Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 45
Default Chartspace Data Source and Connection String Problem

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 OLEDB:Database Password=;"

frmMain.ChartSpace1.ConnectionString = strConnection
frmMain.ChartSpace1.DataMember = "qryDJIA"
frmMain.ChartSpace1.Refresh
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Data connection and formatting problem Kathleen M. Excel Discussion (Misc queries) 0 August 3rd 09 11:22 PM
Importing:Data Connection Wizard Doesn't see Source Data - No Impo Exotic Hadron Excel Discussion (Misc queries) 0 October 1st 08 07:35 PM
Problem getting external data using an existing connection Sharon Dickinson Excel Discussion (Misc queries) 0 December 12th 07 04:16 PM
oledb connection string problem in vb.net Manoj Nair Excel Programming 0 April 15th 06 08:41 AM
Problem: Residual query data? Closing external connection? dule[_8_] Excel Programming 0 March 5th 04 04:38 PM


All times are GMT +1. The time now is 10:01 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"