Connecting To Access DB

TeeChart for ActiveX, COM and ASP
Post Reply
Ironic
Newbie
Newbie
Posts: 1
Joined: Fri Nov 15, 2002 12:00 am

Connecting To Access DB

Post by Ironic » Thu Nov 01, 2007 1:06 pm

Hi,

Trying to connect my tchart to an MS Access Database programticaly I get an error message box claming "Unrecognized Database format + [path of the DB file].
I use TeeChartProActiveX5.
and the code is as follows:

Code: Select all

m_AdocPRO.SetConnectionString("DSN=MS Access Database;DBQ=C:\\orchid\\Bin\\Data\\Sessions\\AlgTestSessions\\000002_030819_00022.mdb;DefaultDir=C:\\orchid\\Bin\\Data\\Sessions\\AlgTestSessions;DriverId=25;FIL=MS Access;MaxBufferSize=2048;PageTimeout=5;UID=admin;");

	m_AdocPRO.SetCommandType(1);
	m_AdocPRO.SetRecordSource("SELECT * FROM CLMPRO");
	m_AdocPRO.Refresh();


	m_CLM_ArcvChart.Series(0).SetDatasourceType(dstSingleRecord);
	m_CLM_ArcvChart.Series(0).SetDataSource((_variant_t)m_AdocPRO.GetRecordset());
	m_CLM_ArcvChart.Series(0).GetYValues().SetValueSource("CDSTFIX");
    m_CLM_ArcvChart.Series(0).GetXValues().SetValueSource("[TimeStamp]");
Can anyone tell what's wrong with the code or TeeCahrt doesnt support MS access Databases?

Thanks!

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Post by Narcís » Fri Nov 02, 2007 8:37 am

Hi Ironic,

I recommend you to have a look at Tutorial 8 - ADO Database access and the example at C:\Program Files\TeeChart Pro v5 ActiveX Control\Examples\Access 2000. You'll find the tutorials at TeeChart's program group.

If this doesn't help don't hesitate to let us know.
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

Post Reply