IonicWind Software

Aurora Compiler => Database => Topic started by: efgee on March 30, 2006, 06:34:03 PM

Title: How to connect to a DataBase Server
Post by: efgee on March 30, 2006, 06:34:03 PM
I've installed the new demo and tried to change the database example.

The database example connects to a local file, but how do I connect to a  DataBase Server?

I have the database name, user name, and password.

I can connect with other prg-languages, but until now no luck with Aurora.
Need more infos.

Thanks
Title: Re: How to connect to a DataBase Server
Post by: Parker on March 30, 2006, 07:04:51 PM
You'll need to look up the ODBC connection string, which will probably be something like
USER=username;PASSWORD=password;SERVER=db.something.com;PORT=3376
well... I have no experience with ODBC though, so that's just my guess.
Title: Re: How to connect to a DataBase Server
Post by: John Syl. on March 31, 2006, 06:24:28 AM
If I state the obvious, sorry, but I don't want to assume anything.

I can only speak from the point of[ b] mySQL[/b].

In this instance, using the  Cdatabase class:

Cdatabase db;


and the command you are looking for is:


pdb=db.Connect"MySQL ODBC 3.51 Driver","","database=<dbname>;server=<server>;port=3306;uid=<username>;pwd=<password>");

pdb will be a non-zero value if it connects else it wil be zero.

"MySQL ODBC 3.51 Driver" is the connector driver required and will need to be installed.

If you are using mySQL server remotely then you will need to allow remote access to the database.

If you are accessing the mySQL server on the same machine then the server is 'localhost'.

Once the connection has been made it pretty much straight forward from then on.

Hope this helps
regards
John


Title: Re: How to connect to a DataBase Server
Post by: tekrat on October 18, 2007, 05:29:37 PM
You would need the mySQL ODBC driver installed on your machine and use the connection strings to connect with the mySQL server.  Otherwise you'll have to get a DLL from mySQL and import the DLL functions into your project.

The second option gives you a ton of control and there by speed.  But it also kills you on programming/project overhead.  If you just need to retain your current hairline and would like a speeder coding, ODBC is your best bet.