PDA

View Full Version : Connecting to external Pervasive Database



Steven Marshall
19-Jan-2006, 04:12 AM
Hi All

We want to connect to an external data source, and want to use embedded SQL
to read in this data into our program.

This data is obviously not part of the file list.

Not sure about the last param in the following:

SQLSetConnect of hoSQL ODBC_Driver "??"

Not sure what goes in "??" part:

we have say a Database: Studs
and table inside this Database: Addresses

Also the external data source is a pervasive database.

Also this database has a username, and password:

user: steve
password: fred

How is this taken account of in the connection string.

Any help would be appreciated.

reagrds
Steven Marshall
BizzSoft

Ben Weijers
19-Jan-2006, 04:32 AM
You would use an ODBC data source. You create it in the ODBC administrator.
In the data source you define the database to connect to. Some ODBC drivers
even allow you to define login information in a data source. Then in your
DataFlex program you use the data source name in the SQLConnect function. If
you defined the login credentials in the data source there's no need to pass
them again so yo would get something like:

Get SQLConnect Of hoSQL "ODBC_DRV" "DSN=MyDataSource" To hdbc

Alternatively if you don't define the user credentials in the data source
you will have to pass them to the connect function like:

Get SQLConnect Of hoSQL "ODBC_DRV" "DSN=MyDataSource;UID=steve;PWD=fred" To
hdbc

Oh, btw, the command interface to Embedded SQL is obsolete, it is not
recommended to be used.

Regards,

Ben Weijers
Data Access Worldwide

Steven Marshall
19-Jan-2006, 06:16 AM
Hi Ben

Thanks for the info. So should we be using the message interface.

So should we use:

Send SQLSetConnect of hoSQL "ODBC_DRV" "DSN=MyDataSource"
Get SQLConenct of hoSQL "" "" to hdbc

or is there another way.

regards
Steven Marshall

"Ben Weijers" <Ben.Weijers@dataaccess.nl> wrote in message
news:CVYBItNHGHA.1712@dacmail.dataaccess.com...
> You would use an ODBC data source. You create it in the ODBC
> administrator. In the data source you define the database to connect to.
> Some ODBC drivers even allow you to define login information in a data
> source. Then in your DataFlex program you use the data source name in the
> SQLConnect function. If you defined the login credentials in the data
> source there's no need to pass them again so yo would get something like:
>
> Get SQLConnect Of hoSQL "ODBC_DRV" "DSN=MyDataSource" To hdbc
>
> Alternatively if you don't define the user credentials in the data source
> you will have to pass them to the connect function like:
>
> Get SQLConnect Of hoSQL "ODBC_DRV" "DSN=MyDataSource;UID=steve;PWD=fred"
> To hdbc
>
> Oh, btw, the command interface to Embedded SQL is obsolete, it is not
> recommended to be used.
>
> Regards,
>
> Ben Weijers
> Data Access Worldwide
>

Ben Weijers
19-Jan-2006, 09:52 AM
Yes, you should use the message interfasce.

Regards,

Ben WEijers
Data Access Worldwide

Steven Marshall
19-Jan-2006, 03:06 PM
Hi Ben

No problem.

regards
Steven Marshall

"Ben Weijers" <Ben.Weijers@dataaccess.nl> wrote in message
news:0$ZDufQHGHA.1756@dacmail.dataaccess.com...
> Yes, you should use the message interfasce.
>
> Regards,
>
> Ben WEijers
> Data Access Worldwide
>

Dave &/or Wempy
20-Jan-2006, 09:00 AM
>we have say a Database: Studs
>and table inside this Database: Addresses

What's the Application? Paris Hilton's online diary?
Some people's applications are obviously more interesting than
ours.... <g>