Connecting to the database
[1/3] from: belkasri::1stlegal::com at: 17-Jul-2002 14:00
Hi there!
I have a DSN for Access database, let us call it: myDB
I have Rebol/Command/View Pro
I am trying to connect to a Database through ODBC
using the command:
<code>
connect-name: open scheme://localhost/myDB
</code>
It gives the folowing error:
<error>
** Access Error: Invalid port spec: scheme://localhost/myDB
** Where: do-boot
** Near: connect-name: open scheme://localhost/myDB
</error>
This one also doesn't work:
<code>
connect-name: open [scheme: 'odbc target: "{DRIVER=Microsoft Access Driver
(*.mdb)}; DBQ=C:\rebol\view\WorkSpace\mydb.mdb"]
</code>
What am I doing wrong?
--Abdel.
[2/3] from: ammon:rcslv at: 17-Jul-2002 6:44
Hi,
To connect to an ODBC source you first must go to the ODBC control panel
(not a part of REBOL) and make an alias for the database you want to have
available. Then it is as simple as:
>> myDB: open odbc://myDB
>>
Then if you need a username and password:
>> myDB: open odbc://username:[password--myDB]
>>
HTH
Ammon
A short time ago, Abdel Belkasri, sent an email stating:
[3/3] from: rebol:optushome:au at: 20-Jul-2002 7:59
> This one also doesn't work:
> <code>
> connect-name: open [scheme: 'odbc target: "{DRIVER=Microsoft Access Driver
> (*.mdb)}; DBQ=C:\rebol\view\WorkSpace\mydb.mdb"]
> </code>
>
Hi Abdel
The connection string example in the docs has a few typos (corrections were
submitted in Feb)
------------------
Under "Connecting without a DSN (ODBC only)"
The example shows
connect-name: open [scheme: `odbc target: "{DRIVER=Microsoft Access Driver
(*.mdb)}; DBQ=c:\Databses\mydb.mdb"]
it should be
connect-name: open [scheme: 'odbc target: {DRIVER=Microsoft Access Driver
(*.mdb); DBQ=c:\Databses\mydb.mdb}]
----------------
So in your piece of code it should become
connect-name: open [scheme: 'odbc target: {DRIVER=Microsoft Access Driver
(*.mdb); DBQ=C:\rebol\view\WorkSpace\mydb.mdb}]
Cheers,
Allen K