Page 1 of 1

Connecting To Access DB

Posted: Thu Nov 01, 2007 1:06 pm
by 6928898
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!

Posted: Fri Nov 02, 2007 8:37 am
by narcis
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.