Excel ODBC driver
Moderator: Neosoft Support
Excel ODBC driver
Does anyone know what driver is required to connect up NBDBPro to an excel (2003) file? I've tried a couple that don't seem to work.
Or can it not be done?
Or can it not be done?
Don
'If you want to get a brontosaurus from 'a' to 'b' then you ride the dinosaur - you don't carry it!'
'If you want to get a brontosaurus from 'a' to 'b' then you ride the dinosaur - you don't carry it!'
Excel files aren't databases, so I would imagine it wouldn't work with dbpro. I believe Excel 2003+ now uses xml format. I seem to recall there being an excel plugin out there, but I can't remember who created it.
Wrangler
--------------
"You never know about a woman. Whether she'll laugh, cry or go for a gun." - Louis L'Amour
Windows 7 Ultimate SP1 64bit
16GB Ram
Asus GTX 950 OC Strix
Software made with NeoBook
http://highdesertsoftware.com
--------------
"You never know about a woman. Whether she'll laugh, cry or go for a gun." - Louis L'Amour
Windows 7 Ultimate SP1 64bit
16GB Ram
Asus GTX 950 OC Strix
Software made with NeoBook
http://highdesertsoftware.com
Would be cool if you can figure it out. Keep us posted.
Wrangler
--------------
"You never know about a woman. Whether she'll laugh, cry or go for a gun." - Louis L'Amour
Windows 7 Ultimate SP1 64bit
16GB Ram
Asus GTX 950 OC Strix
Software made with NeoBook
http://highdesertsoftware.com
--------------
"You never know about a woman. Whether she'll laugh, cry or go for a gun." - Louis L'Amour
Windows 7 Ultimate SP1 64bit
16GB Ram
Asus GTX 950 OC Strix
Software made with NeoBook
http://highdesertsoftware.com
-
- NeoSoft Team
- Posts: 5628
- Joined: Thu Mar 31, 2005 10:48 pm
- Location: Oregon, USA
- Contact:
You can open an Excel worksheet in DBPro like this:
dbpOpenDatabase "MyDB" "filename.xls"
You don't need to worry about the ODBC driver or connection string. DBPro will take care of it automatically.
Excel stores its worksheet table names a little differently, so you might need to use the following to see what they are before opening a table:
dbpGetTableNames "MyDB" "[#13]" "[WorkSheets]"
You might want to make a copy of the worksheets before playing with them in DBPro. They can be opened without any problems, but they behave like a database rather than a spreadsheet. Formulas won't work.
dbpOpenDatabase "MyDB" "filename.xls"
You don't need to worry about the ODBC driver or connection string. DBPro will take care of it automatically.
Excel stores its worksheet table names a little differently, so you might need to use the following to see what they are before opening a table:
dbpGetTableNames "MyDB" "[#13]" "[WorkSheets]"
You might want to make a copy of the worksheets before playing with them in DBPro. They can be opened without any problems, but they behave like a database rather than a spreadsheet. Formulas won't work.
NeoSoft Support
Gotta love that DBPro. Learned something here. I have a couple of applications that can benefit from it. Thanks, Dave!
Wrangler
--------------
"You never know about a woman. Whether she'll laugh, cry or go for a gun." - Louis L'Amour
Windows 7 Ultimate SP1 64bit
16GB Ram
Asus GTX 950 OC Strix
Software made with NeoBook
http://highdesertsoftware.com
--------------
"You never know about a woman. Whether she'll laugh, cry or go for a gun." - Louis L'Amour
Windows 7 Ultimate SP1 64bit
16GB Ram
Asus GTX 950 OC Strix
Software made with NeoBook
http://highdesertsoftware.com
Not sure if this is worth pointing out, but I will anyway. No only can you use this plugin with excel, but also with csv files in the same way. It will treat them just like any other database. They are simple text files.
csv files are comma-separated-values and look like this:
field1,field2,field3,field4
value1,value2,value3,value4
value1,value2,value3,value4
value1,value2,value3,value4
value1,value2,value3,value4
The first row is a header row and will create column names.
value1 becomes a column named field1
value2 becomes a column named field2 etc.
each of the four values rows are records in the database.
You can easily write these type of text files using Neobook. Many current programs export or write to csv also. The plugin allows you to do many things with this data, sorting, query, adding, report writer, on and on.
Think deep. The possibilities are endlesssssssssss.
csv files are comma-separated-values and look like this:
field1,field2,field3,field4
value1,value2,value3,value4
value1,value2,value3,value4
value1,value2,value3,value4
value1,value2,value3,value4
The first row is a header row and will create column names.
value1 becomes a column named field1
value2 becomes a column named field2 etc.
each of the four values rows are records in the database.
You can easily write these type of text files using Neobook. Many current programs export or write to csv also. The plugin allows you to do many things with this data, sorting, query, adding, report writer, on and on.
Think deep. The possibilities are endlesssssssssss.
Don
'If you want to get a brontosaurus from 'a' to 'b' then you ride the dinosaur - you don't carry it!'
'If you want to get a brontosaurus from 'a' to 'b' then you ride the dinosaur - you don't carry it!'
Re: Excel ODBC driver
i tried this.
but not working..
dbpOpenDatabase "XLS" "E:\EVA Desktop\Project Marc\SourceDB\XLS.xls"
dbpGetTableNames "XLS" "[#13]" "[WorkSheets]"
dbpOpenTable "XLS" "[Worksheets]" ""
it says cant open XXX$
i only have 1 table in the excel..
but not working..
dbpOpenDatabase "XLS" "E:\EVA Desktop\Project Marc\SourceDB\XLS.xls"
dbpGetTableNames "XLS" "[#13]" "[WorkSheets]"
dbpOpenTable "XLS" "[Worksheets]" ""
it says cant open XXX$
i only have 1 table in the excel..
Re: Excel ODBC driver
yanzco:
In any case, [WorkSheets] gets created as an arrayed variable ... so try ...
If that doesn't work, tell us what the value of [WorkSheets1] is ... and the name of your one sheet.
Also, it might help to place an exclamation mark in front of your file name ...
You didn't say what the name of your "sheet in the xls file" was ... is it XXX ?dbpGetTableNames "XLS" "[#13]" "[WorkSheets]"
dbpOpenTable "XLS" "[Worksheets]" ""
it says cant open XXX$
i only have 1 table in the excel..
In any case, [WorkSheets] gets created as an arrayed variable ... so try ...
Code: Select all
dbpOpenTable "XLS" "[Worksheets1]" ""
Also, it might help to place an exclamation mark in front of your file name ...
Code: Select all
dbpOpenDatabase "XLS" "!E:\EVA Desktop\Project Marc\SourceDB\XLS.xls"
Re: Excel ODBC driver
it worked now..
the ! did the trick..
:O
thanks gaev!!
the ! did the trick..
:O
thanks gaev!!