From: Nandish on
"Kirill" <KirillAndreev(a)gmail.com> wrote in message <1161453599.690195.240580(a)b28g2000cwb.googlegroups.com>...
> You need to define Nwind data source on your computer in Control Panel,
> ODBC data sources
>
> or pass connection string into ODBC driver e.g.
>
> % path to database
> dbname = 'DRIVER={Microsoft Access Driver
> (*.mdb)};DBQ=C:\Data\NWind.mdb';
>
>
> where C:\Data\NWind.mdb is complete path to MS Access database file
>
> Kirill Andreev
>

Hello,

I am having the same problem. I define 'tutorial_copy' data sourse on my computer in Control Panel, ODBC data sources.
I was just following steps given in exapmle 'import data in database from MATLAB' in HELP....

> conn = database('tutorial_copy','','')

conn =

Instance: 'tutorial_copy'
UserName: ''
Driver: []
URL: []
Constructor: [1x1 com.mathworks.toolbox.database.databaseConnect]
Message: 'No data found'
Handle: 0
TimeOut: []
AutoCommit: 'off'
Type: 'Database Object'

>> getdatasources

ans =

Columns 1 through 4

'LabVIEW' [1x22 char] [1x20 char] 'dbtoolboxdemo'

Column 5

'tutorial_copy'

>> ping(conn)
??? Error using ==> database.ping
Invalid connection.

where the error is? and what is the solution of it?

Thank you.
From: Nandish on
"Nandish " <nandishpatel.24(a)gmail.com> wrote in message <i2bhjv$s1$1(a)fred.mathworks.com>...
> "Kirill" <KirillAndreev(a)gmail.com> wrote in message <1161453599.690195.240580(a)b28g2000cwb.googlegroups.com>...
> > You need to define Nwind data source on your computer in Control Panel,
> > ODBC data sources
> >
> > or pass connection string into ODBC driver e.g.
> >
> > % path to database
> > dbname = 'DRIVER={Microsoft Access Driver
> > (*.mdb)};DBQ=C:\Data\NWind.mdb';
> >
> >
> > where C:\Data\NWind.mdb is complete path to MS Access database file
> >
> > Kirill Andreev
> >
>
> Hello,
>
> I am having the same problem. I define 'tutorial_copy' data sourse on my computer in Control Panel, ODBC data sources.
> I was just following steps given in exapmle 'import data in database from MATLAB' in HELP....
>
> > conn = database('tutorial_copy','','')
>
> conn =
>
> Instance: 'tutorial_copy'
> UserName: ''
> Driver: []
> URL: []
> Constructor: [1x1 com.mathworks.toolbox.database.databaseConnect]
> Message: 'No data found'
> Handle: 0
> TimeOut: []
> AutoCommit: 'off'
> Type: 'Database Object'
>
> >> getdatasources
>
> ans =
>
> Columns 1 through 4
>
> 'LabVIEW' [1x22 char] [1x20 char] 'dbtoolboxdemo'
>
> Column 5
>
> 'tutorial_copy'
>
> >> ping(conn)
> ??? Error using ==> database.ping
> Invalid connection.
>
> where the error is? and what is the solution of it?
>
> Thank you.


Hello,

The problem has been solved. It was my mistake.
Instead of writing 'Data source Name' in --> conn = database('tutorial_copy'*,'','')
i.e. * dbtoolboxdemo, i had written 'tutorial_copy'.

Thank you.